X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <3FCA24D3.95AF2A3C@phekda.freeserve.co.uk> Date: Sun, 30 Nov 2003 17:11:47 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: C/C++ switch statement question References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 29 NNTP-Posting-Host: 62.3.251.102 X-Trace: 1070211962 mercury.nildram.net 109 62.3.251.102 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello. Chris Mantoulidis wrote: > in my c++ program i use the switch statement with a string parameter. > for example > > string s; > cin >> s; > switch (s) > { > ....... > } > > but i get an error saying "switch quantity not an integer"... probably > the switch needs an integer parameter and probably that's the same > with C (and a char * in the example). > > so... there is no way that i can use switch for a string? > > i have to use IF-ELSE??? Yes. Regards, -- Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek