|
From: Jared E. <ja...@vo...> - 2001-01-18 09:45:55
|
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
|