D
Doomster
That was asked by someone and I don't know.
Doomster said:That was asked by someone and I don't know.
ActuallyAli said:Another difference is that, in C++, main could be exited without executing a
return statement. In C, there had to be a return statement. (I don't know
whether the "new C" has changed this.) i.e.:
int main() {}
would be legal program in C++; but it had to be written as
int main() { return 0; }
in C. Again, this difference might have disappeared...
Ali said:news:dc9104c572e279fa82e8eb6d3e7ba73b@localhost.talkaboutprogramming.com...
One difference is that in C, main can be called recursively from within
the program. Not so in C++...
Another difference is that, in C++, main could be exited without executing
a return statement. In C, there had to be a return statement. (I don't
know whether the "new C" has changed this.) i.e.:
int main() {}
would be legal program in C++; but it had to be written as
int main() { return 0; }
in C. Again, this difference might have disappeared...
Another difference is that in C, main() is always the first thing to
be executed, while in C++, constructors of global objects are executed
before main().
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.