Subj : Re: "File Scope" objects To : comp.programming,comp.software-eng From : Gerry Quinn Date : Thu Aug 18 2005 01:01 pm In article , phlipcpp@yahoo.com says... > For C++, many classes should live only inside a .cpp file. (Put another way, > many C++ newbies think that all class definitions only belong in header > files, which is wrong.) You want to define class B in the implementation file of class A, i.e. "a.cpp". But suppose class B is written as normal, i.e. "b.h" and "b.cpp", but "b.h" is included only in "a.cpp". You won't be looking at "b.h" anyway except by way of finding an include in "a.cpp". So why worry about it? Doing thing the normal way gives effectively the same result, and stops classes contaminating each others files. Only if you are sure B will be useless without A do you gain anything - and even then, you have a longer, more unwieldy file, in which functions of two classes have to be kept in order. Or you use something like MSVC that obscures the details of file structure by creating hyperlinks to functions, in which case there is also no benefit. - Gerry Quinn .