valid main declaration

A

Alf P. Steinbach

* Pep:
Why don't you compile it and see?

The result of that approach depends on the compiler, although some compilers,
such as <url: http://www.comeaucomputing.com/tryitout/>, are fairly reliable
guides to what the standard is.

'void main' is not valid C++, and not valid C, and never has been.

The OP should check this group's FAQ, and also Bjarne Stroustrup's C++ FAQ.
 
R

Rui Maciel

Pep said:
Why don't you compile it and see?

There are compilers which take a "creative license" from the standards when
compiling code. Because of that, some compilers compile code which isn't
standard compliant and should be broken to begin with. Therefore, the test
you suggested isn't the best way if a piece of code is valid or not.


Best regards
Rui Maciel
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top