delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/10/02:44:21

From: Chris Mears <cmears AT bigpond DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: SV: switch
Organization: only if absoultely necessary
Message-ID: <uim3ksca9esukpf6huhdjlbrcrgp004i10@4ax.com>
References: <8hrgn0$e19$1 AT nnrp1 DOT deja DOT com> <5te05.12211$Za1 DOT 193667 AT newsc DOT telia DOT net>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Lines: 26
Date: Sat, 10 Jun 2000 16:05:17 +1000
NNTP-Posting-Host: 203.54.56.199
X-Trace: newsfeeds.bigpond.com 960616621 203.54.56.199 (Sat, 10 Jun 2000 15:57:01 EST)
NNTP-Posting-Date: Sat, 10 Jun 2000 15:57:01 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Fri, 09 Jun 2000 22:46:25 GMT, that hoopy frood Fredrik Persson
scribbled the following:

>it isnt hard at all u do the same:
>
>string answer;
>switch(answer)
>{
>case "alt 1":
>cout<<"bla bla";
>break;
>
>and so on...

Not quite.

[...]
switch.cc:9: switch quantity not an integer
switch.cc:10: case label `"alt 1"' does not reduce to an integer
constant

The switch construct only works with integral types.

-- 
Chris Mears
ICQ: 36697123

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019