So I understand the difference between a translation unit and a .cpp
file; however, I am trying to test how internal & external linkages work. I quote from my textbook:
Names having external linkage are available to other translation units.
How is it even possible for a name to be available to more than one translation unit? I believe you can compile more than one translation unit into a .obj
file, but how can I do that in Visual Studio?
I know when you compile a file that has `#include”OTHER_FILE.cpp” then it’s still one translation unit. I tried on looking on Stackoverflow about how to compile more than one translation unit in a C++ program, but all the posts explain what the difference between a file and a translation unit and not actually how to create more than one translation unit for a program.
Any explanation would be great.
2