Difference Between gcc and g++ Compilers

Difference Between gcc and g++ Compilers

GCC (GNU Compiler Collection) is a collection of compilers for various programming languages such as C, C++, Objective-C, Objective-C++, Fortran, Ada, D, and Go. GCC is a part of GNU Project. GCC includes gcc and g++ compilers.

The following table provides main differences between gcc and g++ compilers.

No.gccg++
1.Mainly used for compiling programs written in C programming language.Mainly used for compiling programs written in C++ programming language.
2.Allows to compile .c and .cpp files and they treated as C and C++ files respectively.Allows to compile .c and .cpp files and they treated as C++ files by default.
3.By default, the object files are not linked with the C++ standard library.Automatically links the object files with the C++ standard library.

Leave a Comment

Cancel reply

Your email address will not be published.