Language Basics
Character Set
valid characters that can see in C program
small alphabets: a-z
Capitals: A-Z
numbers: 0-9
Symbols: %,#
Special Chars: Space, Tab etc
Tokens
any valid meaningful word(keyword), identifier, symbol or punctuation mark that is identified by the compiler by the time it is reading our source code.
Keywords
these are pre-defined words that has specific meaning in that language and to be used in the same context while writing code.
there are 32 keywords in C Language.
Eg: int, for, while, goto, float, switch etc.
valid characters that can see in C program
small alphabets: a-z
Capitals: A-Z
numbers: 0-9
Symbols: %,#
Special Chars: Space, Tab etc
Tokens
any valid meaningful word(keyword), identifier, symbol or punctuation mark that is identified by the compiler by the time it is reading our source code.
Keywords
these are pre-defined words that has specific meaning in that language and to be used in the same context while writing code.
there are 32 keywords in C Language.
Eg: int, for, while, goto, float, switch etc.
all the keywords of c language are to be entered in lower case.
C Lang is case sensitive Language.
Identifier
Identifier is a name selected by the programmer to his program elements like variable, function, array, pointer etc.
rules to select an identifier:
1. keyword should not be used.
2. the first letter must be an alphabet or underscore but not number. but number can be seen from 2nd letter onwards.
3. no spaces or special characters or symbols except underscore are allowed.
4. both upper and lower case alphabets are allowed.
Invalid Identifiers:
int
1stNo
first name
CLang@1
Valid Identifiers:
INT
_1stNo
No1
first_name
firstName
All alphabets like a,b,c….z
>>>Variable
it is a memory location to store some type of data.Since the data that is storing in the memory space can vary during program execution it is called as ‘Variable’.
Variable is referring with an identifier through out the program.