-
October 17th, 2005, 01:02 PM
#11
Yeah.. I've noticed..
even with the -ansi flag or worse yet -std=gnu89
I allways thought an empty main() was only allowed in C++
/me looks for his "A Book on C" and "C++ for C programmers" books..
ASCII stupid question, get a stupid ANSI.
When in Russia, pet a PETSCII.
Get your ass over to SLAYRadio the best station for C64 Remixes !
-
October 17th, 2005, 01:03 PM
#12
Since C is just a subset of the C++ language, it's correct to call it C++. Even though C is an older language than C++, it doesn't mean it won't compile in a C++ compiler.
That's actually what C++ means... It's C plus some additional functionality.
-
October 17th, 2005, 01:18 PM
#13
Originally posted here by the_JinX
Yeah.. I've noticed..
even with the -ansi flag or worse yet -std=gnu89
I allways thought an empty main() was only allowed in C++
Main isn't empty. It's defined to return an int.. int main() {...}.
IIRC it's correct to define an empty (void) parameter list.
http://www.comeaucomputing.com/techtalk/#voidmain
Oliver's Law:
Experience is something you don't get until just after you need it.
-
October 17th, 2005, 03:20 PM
#14
Since C is just a subset of the C++ language
Actually C++ is a superset of C.
cheers,
catch
PS. Please don't both to neg me with "wah! supersets must contain subsets!" I was being facetious.
-
October 17th, 2005, 06:32 PM
#15
The code is ANSI C Yes, ANSI, you're allowed to declare main() like that in ANSI C but not in C++. The includes for C++ usually don't keep the .h suffix.
In terms of warnings I'd append -Wall to my flags as a general good practice.
/ \\
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|