Hi all. Just wrote a VERY simple app. I have tried this in both VS 2008 *and* Eclipse; it won't work in EITHER (or compiling it from G++ in terminal on my Mac!).
What on EARTH is going on?!!!
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
usingnamespace std;
int main()
{
int counter = 0;
while (counter < 1000);
{
counter++;
cout << counter;
}
return 0;
}
Hey!. Well I compiled it on: Xcode (Mac), Visual Studio '08 (PC), Eclipse (Mac) and also via g++ (Mac - command line) and it doesn't work on ANY platform whatsoever - it just hangs with no output whatsoever. WEIRD.
PS: It's not an INFINITE loop; the 'while' loop exits, when it reaches 1000.
Thankyou so much for your help, Vince. I would have been chasing my tail ALL NIGHT, and it would have probably ended in much frustration. It's often the simplest errors that cause the most problems, because they are SO small and often go unnoticed!.