How text becomes executable - complier, linker

Hi, I have done a little c++ before, But I have never really progressed with it. So I have decided to give pluralsight a try, and the first thing it is teaching is about creating an executable, and it is talking about compiler and linking.

It says that source code is transformed into an object file, and a large program is made of several source files. So I am wondering. I know you can have multiple cpp files, is one of those cpp files a source file? And in that case does that mean for each cpp file is one object file created? If, for instance, I had a class created in a cpp file called student, and another class in another cpp file called grades. Would i then end up with two object files, a student object file and a grade object file? And then those are all linked together to created the exe?

Thank you for any answers, I just want to make sure I get everything right this time around learning this stuff, and not waste my time assuming stuff which is wrong.
I know you can have multiple cpp files, is one of those cpp files a source file?
All of them are.

And in that case does that mean for each cpp file is one object file created?
That's basically correct. Each translation unit is compiled into an object file.

Would i then end up with two object files, a student object file and a grade object file? And then those are all linked together to created the exe?
Yes.
Topic archived. No new replies allowed.