01. /* file name: myclass. H 02. * Abstract: 03.*04. * Current Version: 05. * Author: 06. * Completion Date: 07.*08. * update Description: 09.*10. */11. 12. # ifndef myclass_h _ 13. # define myclass_h _ 14. 15. # include <string> // standard library header file 16. 17. # include "Other. H "// custom header file 18. 19. int g_initvalue;/the global variable starts with G. 20. Const int max = 100; // constants should all be capitalized. 21. 22. struct mystruct // global struct Declaration 23. {24. int num; 25. string name; 26. string address 27 .}; 28. 29. void addnumber (void); // The function name should use a verb or verb + noun. Uppercase letters are separated by uppercase letters. If no parameter is set, enter void. 30. 31. Class myclass // class declaration. The first letter of the class name is uppercase and separated by uppercase. 32. {33. public: 34. int addarea (INT width, int height); 35. 36. PRIVATE: // we recommend that you put the variable declaration behind it and take "action" as the center. You are concerned about interfaces. 37. Enum {size = 100, sizet = 200}; // The enumerated constant 38. Int m_width; 39. Int m_height; // The data member of the class starts with M. Avoid the Same Name of the data member and the member function parameter. 40. Static int s_initvalue; // The static variable starts with "S. 41. 42.}; 43. 44. # endif </span>