|
-
Oct 21st, 2001, 02:33 PM
#1
Sams Book p.170
I tryed to make that exercice ( 7.3) for fun and I got 3 errors who I cannot solve.
THis is my code :
Code:
#include <iostream>
using namespace std;
int main()
{
unsigned short small;
unsigned short large;
const unsigned short MAXSMALL=65535;
cout<<"Enter a small number: ";
cin >> small;
cout<<"Enter a large number: ";
cin >> large;
cout<< "Your small number is : " <<small<<"...";
while (small < large && large > 0 && small < MAXSMALL)
{
if (small % 5000 ==0)
cout<<".";
small++;
large-=2;
}
cout << "\nSmall: " << small << "\nLarge: " << large <<endl;
return 0;
}
This is the errors :
Configuration: LoopBaby - Win32 DebugCompiling...
loopWhile.cpp
Linking...
loopWhile.obj : error LNK2005: _main already defined in WHile.obj
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/LoopBaby.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
LoopBaby.exe - 3 error(s), 0 warning(s)
-
Oct 21st, 2001, 04:25 PM
#2
Frenzied Member
Make sure you are making a console app and not a win32 one.
-
Oct 21st, 2001, 05:05 PM
#3
ok I will check that after dinner.
-
Oct 23rd, 2001, 07:02 PM
#4
Yes that was the error oops
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|