Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Since in CC++Java -

int 2a ; //invalid suffix "a" on integer constant

Is there nothing wrong with digits in the rest of variant name although it's valid syntax ?

Like -

int num1 ;
int num_1st ;
int num_2nd ; 
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
138 views
Welcome To Ask or Share your Answers For Others

1 Answer

I've never heard of anybody (e.g., any coding standards/guidelines) that had a problem with digits in an identifier. Nonetheless, too many of them can indicate that a vector or array might be preferable -- even with only two, your num_1st and num_2nd might be better as numbers[2].


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...