www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/10/20:33:22

Date: Tue, 10 Feb 1998 20:32:35 -0500 (EST)
Message-Id: <199802110132.UAA29838@p2.acadia.net>
To: nguyen2 AT tidalwave DOT net_REMOVE (Linh Nguyen)
Subject: Re: Beginner, switch statement in DJGPP
Cc: djgpp AT delorie DOT com
References: <34e0b800 DOT 2267079 AT newsdesk DOT tidalwave DOT net>
in-reply-to: <34e0b800.2267079@newsdesk.tidalwave.net>
From: swarnerx3 AT acadia DOT net (Scott Warner)
MIME-Version: 1.0

Something like,

switch(Num)
{
	case 1:
	case 10:
	case 6:
	cout << "Test";
	break;

	// yadda
}

I think

In message <34e0b800 DOT 2267079 AT newsdesk DOT tidalwave DOT net>, nguyen2 AT tidalwave DOT net_REMOVE (Linh Nguyen) wrote:
> Hi.  I use Borland C++ 5 at school, and coded the switch statement as
> follows...
>
> switch(Num)
> {
> case 1, 10, 6: cout << "Test"; break;
> ....... and so on and so forth
> }
>
> but in DJGPP, it won't let me do that, it only lets me have one
> possibility for each case statement, so it would be like this..
>
> case 1:  ...
> case 10:  ...
> case 6:  ...
>
> Is there any way around this?  Thanks for any help!
>
>

- Raw text -


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