Why can't variable names start with numbers in C?

Source: Internet
Author: User
C language: the variable must contain English letters or underscoresStartBy letters,NumberCharacter Sequence composed of and underlines
 
Why cannot I start the C variable with a number? Have you ever thought about this? Hey, here I will summarize it for you. (From various websites)
 
1. popular saying:
If the variable name can start with a number, the syntax analyzer cannot determine whether it is a numerical constant or a variable name when parsing a string of all numbers;
 
This is for the convenience of making the compiler. If you have learned the compilation principle, you will know that if the first character can be a number, it will be quite painful, this increases the difficulty of this method, so the C language variable does not start with a number. There is no reason for this. This is a hard rule. You only need to follow this rule. Otherwise, an error will be reported during compilation.ArticleFrom raid network [www.tuxi.com.cn] original link: http://www.tuxi.com.cn/888-911-9117669.html
 
2. authoritative statement:
 
To avoid confusion with numeric values and facilitate lexical analysis.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.