www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/22/07:11:18

From: Martin Ambuhl <mambuhl AT earthlink DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie on the 'switch'
Date: Sun, 22 Aug 1999 03:01:31 -0400
References: <37BF61EB DOT 2DD26DC0 AT rug DOT ac DOT be>
X-Posted-Path-Was: not-for-mail
X-Accept-Language: en
X-ELN-Date: 22 Aug 1999 06:59:44 GMT
X-ELN-Insert-Date: Sun Aug 22 00:05:15 1999
Organization: Nocturnal Aviation
Lines: 35
Mime-Version: 1.0
NNTP-Posting-Host: dialup-209.244.103.173.newyork2.level3.net
Message-ID: <37BFA04B.AE7A7B1B@earthlink.net>
X-Mailer: Mozilla 4.61 [en] (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Bram de Greve wrote:
> 
> Hi,
> 
> when you use switch like this:
> 
> switch (choice)
> {
> case 0: cout << "This is one thing." << endl;
>         break;
> case 1: cout << "This is one thing." << endl;
>         break;
> case 2: cout << "This is another thing." << endl;
>         break;
> default:cout << "Default!" << endl;
> 
> Is there any way to combine case 0 and 1 into one line l,


case 0:
case 1:
     cout << "This is either thing 0 or thing 1." << endl;
     break;




-- 
Martin Ambuhl	mambuhl AT earthlink DOT net

__________________________________________________________
Fight spam now!
Get your free anti-spam service: http://www.brightmail.com

- Raw text -


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