Should all structures and classes in the header file be declared?
Yes. EDIT: But their implementation should be in cpp files. Sometimes users from C # or Java do not realize that a C ++ implementation can be completely separate from the class declaration.
If I declare a struct / class in the source file, what do I need to put in the header file so that it can be used in other files?
You can not. The compiler needs a complete declaration of the class available in any translation unit that uses this class.
Also, are there any resources that show some standard C ++ working methods?
You can simply download the source for any number of open source applications. Although the only fully compatible thing you are likely to see is using heading protection and saving all ads in header files.
Billy oneal
source share