X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Thomas8675309 AT yahoo DOT com (Tom) Newsgroups: comp.os.msdos.djgpp Subject: Re: C/C++ switch statement question Date: 1 Dec 2003 07:50:36 -0800 Organization: http://groups.google.com Lines: 14 Message-ID: <7b68d58f.0312010750.7525d94e@posting.google.com> References: <3FCA24D3 DOT 95AF2A3C AT phekda DOT freeserve DOT co DOT uk> NNTP-Posting-Host: 63.72.148.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1070293836 8124 127.0.0.1 (1 Dec 2003 15:50:36 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Mon, 1 Dec 2003 15:50:36 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Jude DaShiell wrote: > First, put an error message in as default: value for switch. Then you > might try an integer cast for the string value before switch gets to have > the variable. This won't work. You can't cast a std::string to an int. You can't even use this hack with const char*, because two const char* pointers that point to equivalent values will probably be stored at different locations. Best regards, Tom