Thread: [Dev-C++] Program won't compile
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: <k.a...@at...> - 2006-10-19 09:56:21
|
Can someone please help me. I ran this program a couple of times in my compiler Dev C++ several times and I keep getting errors but I can't find the errors. I am new to C++ and I am a teacher trying to teach my students game design. I have listed the source codes that I am using. // Game Stats // Demonstrates declaring and initializing variables #include <iostream> using namespace std; int main() { int score; double distance; char playAgain; bool shieldsUp; short lives, aliensKilled; score = 0; distance = 1200.76; playAgain='y'; shieldsUp= true; lives =3; aliensKilled = 10; double engineTemp = 6572.89; cout << "\nscore:" << score << endl; cout <<"distance: " <<distance<< endl; cout <<"playAgain:" <<playAgain << endl; //skipping shieldsUp since you don't generally print Boolean values cout<<"lives:" <<lives <<endl; cout <<"aliensKilled: " <<aliensKilled << endl; cout << " engineTemp:" <<engineTemp << endl; int fuel; cout << "\nHow much fuel?"; cin >> fuel; cout<<"fuel:" << fuel << endl; typedef unsigned short int ushort; ushort bonus = 10; cout << "\nbonus:" << bonus << endl; system ("PAUSE"); return 0; } Kathy Elia- k.a...@wo... |
From: Per W. <pw...@ia...> - 2006-10-19 11:45:45
|
Nothing wrong with the source, except that you have used some very starnge characters for indentation. White space may only be space, tab, horizontal tap, carriage return and line feed. If you open the source in the really stupid program edit, the strange characters will be clearly visible. /Per W On Thu, 19 Oct 2006 k.a...@at... wrote: > Can someone please help me. I ran this program a couple of times in my compiler Dev C++ several times and I keep getting errors but I can't find the errors. > > I am new to C++ and I am a teacher trying to teach my students game design. I have listed the source codes that I am using. > > > // Game Stats > // Demonstrates declaring and initializing variables > #include <iostream> > using namespace std; > int main() > { > int score; > double distance; > char playAgain; > bool shieldsUp; > > short lives, aliensKilled; > > score = 0; > distance = 1200.76; > playAgain='y'; > shieldsUp= true; > lives =3; > aliensKilled = 10; > > double engineTemp = 6572.89; > > cout << "\nscore:" << score << endl; > cout <<"distance: " <<distance<< endl; > cout <<"playAgain:" <<playAgain << endl; > //skipping shieldsUp since you don't generally print Boolean values > cout<<"lives:" <<lives <<endl; > cout <<"aliensKilled: " <<aliensKilled << endl; > cout << " engineTemp:" <<engineTemp << endl; > > int fuel; > cout << "\nHow much fuel?"; > cin >> fuel; > cout<<"fuel:" << fuel << endl; > > typedef unsigned short int ushort; > ushort bonus = 10; > cout << "\nbonus:" << bonus << endl; > system ("PAUSE"); > return 0; > } > Kathy Elia- > k.a...@wo... |
From: William H. <ab...@to...> - 2006-10-20 07:06:25
|
It compiles just without problem on my system Regards Bill Henderson ----- Original Message -----=20 From: k.a...@at...=20 To: Dev C++=20 Sent: Thursday, October 19, 2006 11:56 Subject: [Dev-C++] Program won't compile Can someone please help me. I ran this program a couple of times in = my compiler Dev C++ several times and I keep getting errors but I can't = find the errors. =20 I am new to C++ and I am a teacher trying to teach my students game = design. I have listed the source codes that I am using. =20 // Game Stats // Demonstrates declaring and initializing variables #include <iostream> using namespace std; int main() { int score; double distance; char playAgain; bool shieldsUp; =20 short lives, aliensKilled; =20 score =3D 0; distance =3D 1200.76; playAgain=3D'y'; shieldsUp=3D true; lives =3D3; aliensKilled =3D 10; =20 double engineTemp =3D 6572.89; =20 cout << "\nscore:" << score << endl; cout <<"distance: " <<distance<< endl; cout <<"playAgain:" <<playAgain << endl; //skipping shie ldsUp since you don't generally print Boolean = values cout<<"lives:" <<lives <<endl; cout <<"aliensKilled: " <<aliensKilled << endl; cout << " engineTemp:" <<engineTemp << endl; =20 int fuel; cout << "\nHow much fuel?"; cin >> fuel; cout<<"fuel:" << fuel << endl; =20 typedef unsigned short int ushort; ushort bonus =3D 10; cout << "\nbonus:" << bonus << endl; system ("PAUSE"); return 0; } Kathy Elia- k.a...@wo...=20 -------------------------------------------------------------------------= ----- = -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 -------------------------------------------------------------------------= ----- _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |