help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a valid statement??


From: address@hidden
Subject: a valid statement??
Date: Tue, 29 Apr 2008 04:00:54 -0700 (PDT)
User-agent: G2/1.0

In my program I have the following statements

void Person::setTitle(const Glib::ustring& str) {
    switch ( str ) {
    case "None" : {
        title = title_t::None;
        break;
    }
    case "Dr"   : {
        title = title_t::Dr;
        break;
    }
......
    case "Rabbi" :{
        title = title_t::Rabbi;
        break;
   }
   case "Shaykh" :{
        title = title_t::Shaykh;
        break;
   }
    default     : {
        title = title_t::None;
        break;
    }
    }// switch
}//Method

when compiling I get an error code that reads:
==== error: switch quantity not an integer  ====
Which is true, but according to

http://newdata.box.sk/bx/c/htm/ch07.htm#Heading54

the error is unwarranted, since the parameter received by the method
and later on given to the switch statement for scrutiny is a valid C/C+
+ statement [setTitle(const Glib::ustring& str)]

Can anyone shed some light to this problem?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]