title: Variable Naming Conventions in C++
body: <p>I come from a .NET world and I'm new to writting C++. I'm just wondering what are the preferred naming conventions when it comes to naming local variables and struct members.</p>
  
  <p>For example, the legacy code that I've inheritted has alot of these:</p>
  
  <pre><code>struct MyStruct
  {
     TCHAR           szMyChar[STRING_SIZE];
     bool            bMyBool;
     unsigned long   ulMyLong;
     void*           pMyPointer;
     MyObject**      ppMyObjects;
  }
  </code></pre>
  
  <p>Coming from a C# background I was shocked to see the variables with hungarian notation (I couldn't stop laughing at the pp prefix the first time I saw it).</p>
  
  <p>I would much rather name my variables this way instead (although I'm not sure if capitalizing the first letter is a good convention. I've seen other ways (see links below)):</p>
  
  <pre><code>struct MyStruct
  {
     TCHAR           MyChar[STRING_SIZE];
     bool            MyBool;
     unsigned long   MyLong;
     void*           MyPointer;
     MyObject**      MyObjects;
  }
  </code></pre>
  
  <p>My question: Is this (the former way) still a preferred way to name variables in C++?</p>
  
  <p>References:</p>
  
  <p><a href="http://geosoft.no/development/cppstyle.html" rel="noreferrer">http://geosoft.no/development/cppstyle.html</a></p>
  
  <p><a href="http://www.syntext.com/books/syntext-cpp-conventions.htm" rel="noreferrer">http://www.syntext.com/books/syntext-cpp-conventions.htm</a></p>
  
  <p><a href="http://ootips.org/hungarian-notation.html" rel="noreferrer">http://ootips.org/hungarian-notation.html</a></p>
  
  <p>Thanks!</p>