Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello,everyone,I do not know this c++ code meaning,I hope to get answer,thank!
C++
enum severity {
        severity_remark = 0,
        severity_warning,
        severity_error,
        severity_fatal,
        severity_commandline_error
}; 
inline char const *get_severity(severity level) 
{
        static char const *severity_text[] =  // static char const *
        {
            "remark",           // severity_remark
            "warning",          // severity_warning
            "error",            // severity_error
            "fatal error",      // severity_fatal
            "command line error"    // severity_commandline_error
        };
    BOOST_ASSERT(severity_remark <= level && level <= severity_commandline_error);
    return severity_text[level];
}

static char const *severity_text[]=
{
......
}
What is the meaning of this code?
Posted
Updated 19-Mar-12 8:16am
v4
Comments
Sergey Alexandrovich Kryukov 19-Mar-12 14:13pm    
Again: not a valid question.
--SA

1 solution

It returns a string representation of severity in response to a value of this type.

—SA
 
Share this answer
 
Comments
C++Kernel 19-Mar-12 14:15pm    
I Update
Sergey Alexandrovich Kryukov 19-Mar-12 14:20pm    
A const array of strings.
--SA
C++Kernel 19-Mar-12 14:21pm    
thank SA!
Sergey Alexandrovich Kryukov 19-Mar-12 14:55pm    
Sure.
Good luck,
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900