help!
my whole code is working fine.. but i want to add another do-while loop outside all functions and i get this error:
|
error: expected unqualified-id before 'do'
|
"outside all functions"? aren't you doing it outside main function by any chance? can you show the code?
Are you trying to put the do/while outisde of a function? As in global scope? loops must be inside of local scopes. Ex:
This works
1 2 3 4 5 6 7
|
int main()
{
do
{
//stuff
} while( condition is true );
}
|
this does not work:
1 2 3 4 5 6 7
|
do
{
int main()
{
//stuff
}
} while( condition is true );
|
yea.. i did mean the main function :P
i figured out how to do that.. thanks :D
Topic archived. No new replies allowed.