X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: cmad_x AT yahoo DOT com (Chris Mantoulidis) Newsgroups: comp.os.msdos.djgpp Subject: C/C++ switch statement question Date: 30 Nov 2003 08:40:03 -0800 Organization: http://groups.google.com Lines: 17 Message-ID: NNTP-Posting-Host: 212.205.250.82 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1070210404 13820 127.0.0.1 (30 Nov 2003 16:40:04 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Sun, 30 Nov 2003 16:40:04 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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???