naming varables

Can i name a variable 1pwn or pwn1? If I can or cannot, why?
closed account (3hM2Nwbp)
http://cplusplus.com/doc/tutorial/variables/
a variable called either of those two names isn't going to make for very easily readable code, make your variable names descriptive.
Please refer to your textbook regarding variable names.
Name it anything you'd like...(at least make sure it has some sort of meaning :/ )
You can't name a variable 1pwn as it is illegal syntax because it starts with a number. This has to do with the suffix type modifiers like, L, f, and u.
1
2
3
4
5
6
1uL; //unsigned long
1L; //long
1; //int
1f; //float
1.0; //double
1.0f; //float 

Thus, to prevent syntax ambiguity, you cannot name variables starting with a number.
Last edited on
Topic archived. No new replies allowed.