From: "Fredrik Persson" Newsgroups: comp.os.msdos.djgpp References: <8hrgn0$e19$1 AT nnrp1 DOT deja DOT com> Subject: SV: switch Lines: 22 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: <5te05.12211$Za1.193667@newsc.telia.net> Date: Fri, 09 Jun 2000 22:46:25 GMT NNTP-Posting-Host: 62.20.164.161 X-Complaints-To: abuse AT telia DOT com X-Trace: newsc.telia.net 960590785 62.20.164.161 (Sat, 10 Jun 2000 00:46:25 MET DST) NNTP-Posting-Date: Sat, 10 Jun 2000 00:46:25 MET DST Organization: Telia Internet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com it isnt hard at all u do the same: string answer; switch(answer) { case "alt 1": cout<<"bla bla"; break; and so on... skrev i diskussionsgruppsmeddelandet:8hrgn0$e19$1 AT nnrp1 DOT deja DOT com... > If I use switch , I can only pass numbers (int) to it. How can I pass > words etc to switch and what should I type after 'case' when I do that? > > > Sent via Deja.com http://www.deja.com/ > Before you buy.