#include <iostream.h> //Enables us to access cout
class Cat
{
public:
int GetAge();
void SetAge (int age);
void Meow();
private:
int itsAge;
};
int Cat::GetAge()
{
return itsAge;
}
void Cat::SetAge(int Age)
{
itsAge = Age;
}
void Cat::Meow()
{
cout << "Meow.\n";
}
int main()
{
Cat Bryan;
cout << Bryan.GetAge();
Bryan.SetAge(7);
Bryan.Meow();
cout << Bryan.GetAge();
return 0;
}
Edited by - Anidem on February 24, 2002 12:20:42 PM
unresolved external errors
These are the errors I got when compiling my application, however, I don't understand them. Can someone help?
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Just in case someone needs the code to help figure out the errors:
u should really read the beginners forum before posting this but, since ur obviously a beginnner ill help anywhay.....(assuming your using VC++) you have created a win32 appilcation, which requires knowledge of the winapi, the error says its looking for the win32 equvilant of main() it wants WinMain, you have to build a new project and select win32 console app, then you code will work
BTW, use #include <isotream> its supposedly the "new and better" one, but i dont see a diff
,Matt
-= kill one your a murderer, kill thousands your a conquerer =-
BTW, use #include <isotream> its supposedly the "new and better" one, but i dont see a diff
,Matt
-= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement