Hello :)
currentely learning c++ (on vc++ 2010 express ed.)
but having a little problem with the for loop.
My Code:
#include <iostream>
using namespace std;
int main ()
{
int i;
for (i=0 , i<=10 , ++i)
cout << i;
system ("pause");
return 0;
}
VC++ only accepts it when it's like this :
#include <iostream>
using namespace std;
int main ()
{
int i;
for (i=0 , i<=10 , ++i;;)
cout << i;
system ("pause");
return 0;
}
(requires ;; after the ++i)
The first one should cout 12345678910
but 'cause vc++ doesn't accept it and wants the ;; to be added , it actually
spawns 1111111111111111111111... then.
Please tell me what I did wrong, 'cause really can't find it .
Aah, my apologies for asking such a dumb question :D, didn't notice that inside a for loop " ; " are being used instead of " , ".
Though I wouldn't have mind if you just said so :p.
sry , just read in another topic that it's appearentely making trouble with some virus scanners or smth, but for mere learning app's , I suppose I can live with it for now :)