--------------------Configuration: Practice - Win32 Debug--------------------
Compiling...
Source.cpp
C:\Documents and Settings\Owner\Desktop\Comp Prog\C++\Sams C++\Lesson 10\Practice\Source.cpp(32) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
Practice.exe - 1 error(s), 0 warning(s)
I just picked up two new c++ books and i wrote this little thing to practice using classes, as I just learned about them a few hours ago, and im getting that error message. Here is the source:
Code:/* THE GOAL HERE IS TO MAKE A CAR OUT OF CLASSES. GIVE IT A FEW METHODS, AND THEN USE THEM! */ class Car { public: Car(){cout<<"YOU HAVE A BRAND NEW CAR! THE TANK IS FULL!"<<endl;} ~Car(){} int Drive() {cout<<"VROOM YOU DROVE 10 MILES!"<<endl; GasLeft=GasLeft-1; return(0);} void HonkHorn(){cout<<"HONK HONK! GET OUT OF THE WAY!!!"<<endl; private: int GasLeft=10; }; int main() { Car MyCar; cin.get(); system("cls"); MyCar.HonkHorn(); cin.get(); system("cls"); MyCar.Drive(); return(0); }



LinkBack URL
About LinkBacks


