C++ standards.
Hi every-1.
I''m wondering why VC++6.0''s compiler doesn''t tell me anything when I declare void main(...) whereas GCC does and warns me that I should use int main(...) to comply with the ANSI standard. Is this standard more recent than VC++6.0?? And furthermore, neither does VC++6 recognize the header as , , etc... Do these ".h-less" headers belong to a new standard too??
Thanks for your guidance.
Prog, Hex & Rock''n''Roll :
I don''t like the Prog but the Prog likes me.
Some nice poetry to sweeten your spirit and relax a bit before programming
Visual C++ 6.0 slightly predates the standard, I believe; in any case it is notorious for its poor compliance and is IMHO best avoided.
g++ also causes an error--you get only a warning when compiling c code. I tested this with gcc 3.3.3, but in general c++ is 1002301x more anal than C
anyway, put void main(void) {} in a .c file, compile with gcc -- only a warning. rename .cc, notice an error this time. gcc is correctly reacting differently to c and c++..
so msvc and g++ are behaving the same
be more careful in the future
anyway, put void main(void) {} in a .c file, compile with gcc -- only a warning. rename .cc, notice an error this time. gcc is correctly reacting differently to c and c++..
so msvc and g++ are behaving the same
be more careful in the future
OK. Thanks for having answered so quickly. Is it such a serious issue that M$ always wants to impose us their own home-made standards instead of complying with the ones that should be used? Let''s use Linux!! And how about the ".h-less" header files. Is this also related to standards. I''ve been explained here that only theses files are complying with C++ normalization.
Does Billy want to show that he has a strong personality??
Prog, Hex & Rock''n''Roll :
I don''t like the Prog but the Prog likes me.
Some nice poetry to sweeten your spirit and relax a bit before programming
Does Billy want to show that he has a strong personality??
Prog, Hex & Rock''n''Roll :
I don''t like the Prog but the Prog likes me.
Some nice poetry to sweeten your spirit and relax a bit before programming
quote:Original post by KurtCPP
OK. Thanks for having answered so quickly. Is it such a serious issue that M$ always wants to impose us their own home-made standards instead of complying with the ones that should be used?
Check out VS.NET 2003. It is very standards compliant.
quote:
And how about the ".h-less" header files. Is this also related to standards. I''ve been explained here that only theses files are complying with C++ normalization.
Yes. The c++ standard library headers are all h-less
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement