|
From: Frazell T. <fr...@fl...> - 2001-01-18 10:05:30
|
Would you be able to give me an example I guess I'm leaving beginner
territory :O)
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Jared
Eckersley
Sent: Thursday, January 18, 2001 4:43 AM
To: dev...@li...
Subject: RE: [Dev-C++] Switches
you would use a cin or cin.get statement
At 10:40 PM 1/17/2001 -0500, you wrote:
>How do get it to read keyboard responses etc.
>
>-----Original Message-----
>From: dev...@li...
>[mailto:dev...@li...]On Behalf Of Jared
>Eckersley
>Sent: Wednesday, January 17, 2001 7:05 PM
>To: dev...@li...
>Subject: Re: [Dev-C++] Switches
>
>Here is a little snip for you,
>switch (myvar) {
> case 1:
> cout << "Number 1 detected" << endl;
> break;
> case 2:
> cout << "Number 2 detected" << endl;
> break;
> case 3:
> cout << "Number 3 detected" << endl;
> break;
> default:
> cout << "Anything but 1, 2, or 3 was detected" << endl;
> }
>
>Hope that helps you understand switches a little more.
>
>
>At 05:18 PM 1/17/2001 -0500, you wrote:
>
> >I was referred to use this instead of if / else statements I m trying
to
> >understand how to use it I have read the article on MSDN I ask can
someone
> >write a small program that will get the variable from the keyboard
and a
> >small action for instance if you enter 1 it says the number 1
detected or
> >Z would say the letter z detected as when I see this in use I can
fully
> >understand how to use it thanks :O)
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|