Is there a difference between what a translation unit is in C++ and C?
In other posts, I read that a header and source file makes a translation unit, but
can a source file alone be called a translation unit in C++ where it contains all the definitions in one file?
A translation unit is not “a header and a source file”. It could include a thousand header files (and a thousand source files too).
A translation unit is simply what is commonly known as “a source file” or a “.cpp file” after being preprocessed. If the source file
#includes other files the text of those files gets included in the translation unit by the preprocessor. There is no difference between C and C++ on this matter.