Variable Naming Rules C++

In C++, variable names are identifiers that must follow specific rules.

Here are the key rules for variable naming in C++:

•Start with a letter or underscore: Variable names must start with a letter of the alphabet (A-Z, a-z) or an underscore (_). Letters include both uppercase and lowercase letters.
Use letters, digits, and underscores: Variable names can contain letters, digits (0-9), and underscores (_). However, you cannot use other special characters, such as spaces, punctuation marks, or symbols.
No keywords: Do not use keywords as variable names. Keywords are reserved words in C++ that have special meanings, such as int, for, while, etc.

#30DaysOFCreative 

Popular posts from this blog

Data Types – Sizes & Memor C++.

Whitespace in C++