>From: The Jay Man <ja...@ya...>
>Reply-To: dev...@li...
>To: dev...@li...
>Subject: [Dev-C++] I'm Stumped :(
>Date: Wed, 20 Dec 2000 17:13:47 -0800 (PST)
>
>I have here some code for a small practice program I wrote. I have been
>looking ive the code for about a week now and cannot figure out why I
>get the following error: "Project1 caused an error in PROJECT1.EXE..."
>What is wrong with the code or my computer? Here is the code:
>
[SNIP]
> cin >> "Enter your choice" >> choice;
[SNIP]
>P.S. It DOES compile sucessfully and will run until "cin >> "Enter your
> choice"; Thank you for your time,
Well that's really strange.... It should NOT compile at all, as you are
trying to use the >> operator on an input stream to store data in a const
char pointer. The correct way to do the above is :
cout << "Enter your choice : "<< flush;
cin >> choice;
--
Chad Simmons
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
|