C++ style guide: Difference between revisions

6 bytes removed ,  1 September 2021
m
Adjust heading levels to correct values
m (Add necessary hyphen to title)
m (Adjust heading levels to correct values)
Line 143: Line 143:
names consisting of 1-2 letters.  Do not use mixed case names.
names consisting of 1-2 letters.  Do not use mixed case names.


==== Member Variables ====
=== Member Variables ===


Member variables should use the prefix "m_" whenever possible.
Member variables should use the prefix "m_" whenever possible.


==== Class Variables ====
=== Class Variables ===


Class variables should use the prefix "s_" (for "static") whenever possible.
Class variables should use the prefix "s_" (for "static") whenever possible.


==== Filenames ====
=== Filenames ===


As with m-files, the file name of a C++ source file containing a class should match the name of the class defined within the file.  For example, "password.h" defines the class "password" rather than "passwd.h" which is a common abbreviation for "password".
As with m-files, the file name of a C++ source file containing a class should match the name of the class defined within the file.  For example, "password.h" defines the class "password" rather than "passwd.h" which is a common abbreviation for "password".
1,072

edits