SteveCRM
Nov 14th, 2000, 08:40 PM
This works fine in borland...but I get this in ms:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Guess My Number.exe : fatal error LNK1120: 1 unresolved externals
here is the code
#include <iostream.h>
int number;
int guess;
int dummy;
int main()
{
//until i randomize NUMBER then its just going to be 34
number=34;
cout<<"Welcome To High Low!"<<endl;
cout<<"===================="<<endl;
cout<<"Enter a number between 1 and 100!"<<endl;
cin>>guess;
// if guess<number then it says too low, else it says too high, or if
// you get it, it says congrats
while (guess!=999)
{
if(guess<number)
{
cout<<"Too low! Guess again."<<endl;
cin>>guess;
}
else if(guess>number)
{
cout<<"Too high! Guess again."<<endl;
cin>>guess;
}
else if(guess==number)
{
cout<<"Congratulations! You Win!";
guess = 999;
}
}
//END OF WHILE STATEMENT
cin >> dummy;
return 0;
}
I know, Im a beginner...by the way, it would help me out a lot if you could also tell me how to make random numbers. But whats wrong?!?!?! Borland says its fine... :(
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Guess My Number.exe : fatal error LNK1120: 1 unresolved externals
here is the code
#include <iostream.h>
int number;
int guess;
int dummy;
int main()
{
//until i randomize NUMBER then its just going to be 34
number=34;
cout<<"Welcome To High Low!"<<endl;
cout<<"===================="<<endl;
cout<<"Enter a number between 1 and 100!"<<endl;
cin>>guess;
// if guess<number then it says too low, else it says too high, or if
// you get it, it says congrats
while (guess!=999)
{
if(guess<number)
{
cout<<"Too low! Guess again."<<endl;
cin>>guess;
}
else if(guess>number)
{
cout<<"Too high! Guess again."<<endl;
cin>>guess;
}
else if(guess==number)
{
cout<<"Congratulations! You Win!";
guess = 999;
}
}
//END OF WHILE STATEMENT
cin >> dummy;
return 0;
}
I know, Im a beginner...by the way, it would help me out a lot if you could also tell me how to make random numbers. But whats wrong?!?!?! Borland says its fine... :(