H
hectorchu
Why doesn't my compiler (g++) flag something like this as an error:
int main()
{
}
?
int main()
{
}
?
Why doesn't my compiler (g++) flag something like this as an error:
int main()
{
}
Why doesn't my compiler (g++) flag something like this as an error:
int main()
{
}
?
Because main's special. Try the same thing in another function.
Victor said:No, it isn't. It's ugly, but it's not wrong.
V
Why doesn't my compiler (g++) flag something like this as an error:
int main()
{
}
Following your suggestion, I tried the following:
int f()
{
}
int main()
{
return f();
}
This compiles okay too. So I don't think what I'm describing is
specific to main.
Why doesn't my compiler (g++) flag something like this as an error:
int main()
{
}
?
Invoke it in conforming mode and you will.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.