CPLUSPLUSProper Naming Conventions

Posts 1–4 of 4 · Page 1 of 1
Proper Naming Conventions

Many of you here don't really actually learn C++, most of you just copy paste. Your source code is messy.

I am here to help.

As you know, the primary language most of us use here is C++.

In most programming languages, there are data types.

What are data types?
Fundamental data types are basic types implemented directly by the language that represent the basic storage units supported natively by most systems.

Complete list of fundamental types in C++


So how do you name and declare variables?
Code:
DWORD dwSomething = NULL;
BYTE bySomething = NULL;
int iSomething = NULL;
float fSomething = NULL;
bool bSomething = NULL;
char szSomething[100] = NULL;
void MyFunction()
{
//void stands for nothing. Therefore you do not return any value, hence for your function name you do not have a data type indicator.
}
NOTE: Some developers & programmers use bSomething for both BYTE and bool.

Why does this help?
It allows us as developers & programmers to easily identify the data type easily just by glancing at the variable name.

Disclaimer: The image is not created by me.
Nice tutorial Will improve on how I declare my variables
Nice tutorial for someone that understand basic c++
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us