0

Today I am starting to learn C++. And I have a question. But first I want to say that I searched the internet and I still haven't found the answer to my question. Please do not throw with dusty slippers in me. I am a beginner and my question is :

Are C++ && G++ differents compilers or is it one compiler with many drivers for the programming languages? More precisely, for C and C ++. From what I understand, g++ is a driver for the C++ programming languages. But even here I vaguely understand what a driver for the C++ programming language is and why it is needed. In general, I'm confused. Could you kind people answer this question, because I can't understand? Please. And in the end, I want to say that maybe this question is stupid. But I'm just curious. Or am I not understanding something?

Schedule
  • 13
  • 1
  • 2
  • 9

1 Answers1

4

GCC is the Gnu Compiler Collection, which, as you can see from that link:

The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,...).

So is that one compiler or many compilers? It depends on what you mean by "compiler". The frontends for those different langauges are all separate executables, and then there's the "driver" executable (which is what actually runs when you type gcc or g++ at a command line), which runs the appropriate frontend, and can also run an assembler and linker if appropriate and needed (which are themselves all separate executables).

So there are multiple programs all running under the hood, but it is all arranged as one unified "package" that works together. So if you consider the "compiler" the whole package, then it is one compiler. If you consider the "compiler" just one of the frontends, then it is mulitple compilers.

Chris Dodd
  • 119,907
  • 13
  • 134
  • 226