C Keywords
Keywords are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are part of the syntax and they cannot be used as an identifier.
Keywords are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are part of the syntax and they cannot be used as an identifier.
For example:
int money;
int money;
Here, int is a keyword that indicates 'money' is a variable of type integer. As C is a case sensitive language, all keywords must be written in lowercase. Here is a list of all keywords allowed in ANSI C.There are 32 keywords.
Along with these keywords, C supports other numerous
keywords depending upon the compiler.
Identifier refers to name given to entities such as variables, functions, structures etc. Identifier must be unique. They are created to give unique name to a entity to identify it during the execution of the program. For example:
int money;
double accountBalance;
double accountBalance;
Here, money and accountBalance are identifiers.
Also remember, identifier names must be different from keywords. You cannot use 'int' as an identifier because 'int' is a keyword.
Rules for writing an identifier
- A valid identifier can have letters (both uppercase and lowercase letters), digits and underscores.
- The first letter of an identifier should be either a letter or an underscore. However, it is discouraged to start an identifier name with an underscore.
- There is no rule on length of an identifier. However, the first 31 characters of identifiers are discriminated by the compiler.
- Identifiers are case sensitive ie; X is different from x.
- Keywords should not be used as identifiers.
The following are valid identifiers
x y12 sum_1 _temperature names area tax_rate TABLE
The following names are not valid identifiers for the reasons stated.
2csbmec The first character must be a letter.
mec#cs2b Illegal character #.
order-no Illegal character (-).
mec cs2b Illegal character (blank space)
An identifier can be arbitrarily long. Some implementations of C recognize only the first eight characters, though most implementations recognize more (typically, 31 characters).The identifiers file-manager and file-management are both grammatically valid. Some compilers may be unable to distinguish between them, however, because the first eight letters are the same for each identifier. Therefore, only one of these identifiers should be used in a single C program.
You can choose any name for an identifier (excluding keywords). However, if you give meaningful name to an identifier, it will be easy to understand and work on for you and your fellow programmers.
your article is nice
ReplyDeleteweb programming tutorial
welookups.com
I have read all your articles. I wonder why you can write them. They are easy to understand and accessible. They help me much too. I'm thankful if you can upload more posts later. Thanks for your sharing.
ReplyDeleteHướng dẫn đăng ký B30 VinaPhone, Đăng ký Mimax sinh viên VinaPhone, Đăng ký Mimax50 VinaPhone, Đăng ký 3G VinaPhone 1 ngày chỉ 5K,7K,10K
Looking forward to reading more. Great post. Really looking forward to read more. Keep writing. I think this is a real great post. Really looking forward to read more. Really Cool
ReplyDeletesales notifications app
sales pop master
Looking forward to reading more. Great post. Really looking forward to read more. Keep writing. I think this is a real great post. Really looking forward to read more. Really Cool
ReplyDeleteDiscount master app
Discount master app
For space outside the milk tea shop closer to nature, outdoor space should use speakers with greater capacity, products such as garden speakers, imitation stone speakers, are products with designs The most natural to create interesting feeling when enjoying. Because it must work in the weather conditions heat so the shell is made very firmly with high durability, the quality of the speaker is imported genuine. Good sound, making good clear sound even when used in wide space
ReplyDeleteGái gọi Mỹ Đình - Đình Thôn, gái gọi Nguyễn Khánh Toàn, gái gọi hà nội, gái gọi Phố Cổ - Quán Sứ
Looking forward to reading more. Great blog.Really looking forward to read more. Keep writing
ReplyDeleteapp autoketing
https://apps.shopify.com/shipping-bar-master
https://bit.ly/2BXG37u