Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Why won't this compile?

Name: Anonymous 2008-07-15 23:06

#include <iostream>

using namespace std;

main()
{
int x = 0;
int i = 6;
for (int i = 6; i > 0, i--, x++)
(
         cout << "i = " << i << endl;
         cout << "x = " << x << endl;
)
         if (x != i)
            continue;

cout << "This is now equal." << endl;    

}

Name: Anonymous 2008-07-15 23:18

You are shadowing i and breaking the syntax of the for loop. 

With minimal changes:
int i = 6;
for(i; i-- > 0; x++) {

Name: Anonymous 2008-07-15 23:18

Sigh. Troll harder.

Name: Anonymous 2008-07-15 23:28

You've been (Lisp)ing too hard.

Name: Anonymous 2008-07-16 9:08

>>1
missing return type for main (should be int)
a for loop needs three parts (separated by ;), not just two
blocks are delimited by {}, not ()
can't use continue outside of loops

Name: Anonymous 2008-07-16 9:09

missing return type for main (should be int)
This ain't no Haskell, kid.

Name: Anonymous 2008-07-16 9:14

>>6
This ain't no dog, Haskell.

Name: ​​​​​​​​​​ 2010-09-10 2:32

Name: Anonymous 2010-10-26 21:42

Name: Anonymous 2010-12-17 1:36

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-02-04 19:00


Don't change these.
Name: Email:
Entire Thread Thread List