is it compulsory to have no. 1 to 9 after _ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

is it compulsory to have no. 1 to 9 after _

identifier last paragraph

27th Jul 2016, 4:04 PM
Sanskar Jain
Sanskar Jain - avatar
3 Answers
+ 2
Rules for naming variables in C++ : A variable name should be start with an alphabet or a underscore "_". A variable name can have alphabets "a to z", "A to Z", numbers "0 to 9" and an underscore "_". examples: a a1 _a _1 _a1 a_1 a_11 a13 a16_ _3a abc _abc _ab45 ab45 all of these are correct.
28th Jul 2016, 5:51 AM
Preetam Daila
Preetam Daila - avatar
+ 1
not compulsory at all.. make sure you use identifiers that you remember easily cuz identifiers improves the code readability char fn[10] char ln[10] these aren't the good method of declaring instead use full name char first_name[10] char last_name[10] and avoid special characters.
27th Jul 2016, 4:17 PM
Karan Luther
Karan Luther - avatar
+ 1
thanks
27th Jul 2016, 6:14 PM
Sanskar Jain
Sanskar Jain - avatar