I have a cpp program that I'm having trouble with; particularly in the for loop.
Code:
void myInit() {
glClearColor(0, 0, 0, 0);
glShadeModel(GL_SMOOTH);
//init aliens, took me waaaay too long to figure this out
head_alien = NULL;
/* for (int i = 0; i < row_aliens; i++) {
for (int j = 0; j < col_aliens; j++) {
aliens current;
current.x = al_init_x + j * (alien_size + alien_spacing);
current.y = al_init_y + i * (alien_size + alien_spacing);
current.next = head_alien;
head_alien = ¤t;
}
}
*/
head_bullet = NULL;
cout << "\nNothing yet...\n";
cout.flush();
} //end myInit
I narrowed down the problem to that commented out for loop. If I left it in, I get errors like "error: expected primary-expression before '=' token" for the first for loop amongst others. Am I treating for loops incorrectly for c++? It worked this way in a c program I had. Or is the problem somewhere else entirely?
Also, all the head_alien, row_aliens, col_aliens, etc are either #define or global variables.