PDA

View Full Version : C and C++ compile speed



swgh
01-02-2007, 01:45 PM
Strange one, but when I use DevC++ on the rare ocassion, I have discovered somthing interesting about the compiler.

If I write and compile a C++ program it compiles in the standard compile time.
If I write a C program and ensure it compiles with a .c extension, the compiler
compiles the C code in lightning quick speed, even faster than if was compiling
C++ code with the .cpp extension.

Did the creators of the MINGW compiler intend C programmers to use it in favor of C++? Why does it compile C code faster than C++ code?

Salem
01-02-2007, 02:25 PM
Because C is easier to compile than C++ perhaps?

DavidP
01-02-2007, 02:30 PM
Like Salem said, C is easier to compile. C is a much simpler language that doesnt have to worry about classes, inheritance, templates, etc.

swgh
01-02-2007, 02:37 PM
Ok thanks guys. I didnt think the answer was that simple. :)