add variable prefix
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 25 Aug 2006 09:59:09 +0200
changeset 6 4a89c25520f1
parent 5 df268610ad73
child 7 e53ac3c458e9
add variable prefix
doc/codingstd.tex
--- a/doc/codingstd.tex	Fri Aug 25 09:52:48 2006 +0200
+++ b/doc/codingstd.tex	Fri Aug 25 09:59:09 2006 +0200
@@ -229,6 +229,20 @@
 {\tt int sum1;}\\
 {\tt int loopCount10;}
 
+\item {\bf Class Member and Global Variables}. To be able to distinguish 
+local variables from class member and global variables, prepend the
+\code{m\_} prefix to class member variables and the \code{g\_} prefix
+to global variables.
+
+Examples:
+\begin{verbatim}
+class Foo {
+private:
+    int m_myPrivateVar;
+};
+static int g_myGlobalVar;
+\end{verbatim}
+
 \item {\bf Subroutine Names}.  All subroutine names, including global
 routines and member functions in classes, will start with an upper case
 letter, and consist of only alphabetic characters and numeric digits