Introduction To C and Identifiers
Introduction To C and Identifiers
Features of C Language
1. Simple
2. Machine Independent or Portable
3. Mid-level programming language
4. structured programming language
5. Rich Library
6. Memory Management
7. Fast Speed
8. Pointers
9. Recursion
10. Extensible
1) Simple
C is a structured programming language in the sense that we can break the program
into parts using functions. So, it is easy to understand and modify. Functions also
provide code reusability.
5) Rich Library
6) Memory Management
7) Speed
The compilation and execution time of C language is fast since there are lesser inbuilt
functions and hence the lesser overhead.
8) Pointer
C provides the feature of pointers. We can directly interact with the memory by using
the pointers. We can use pointers for memory, structures, functions, array, etc.
9) Recursion
In C, we can call the function within the function. It provides code reusability for
every function. Recursion enables us to use the approach of backtracking.
10) Extensible
reserved words in C programming that are part of the syntax. Also, we will learn
about identifiers and how to name them.
Character set
A character set is a set of alphabets, letters and some special characters that are valid
in C language.
Alphabets
Uppercase: A B C ................................... X Y Z
Lowercase: a b c ...................................... x y z
C accepts both lowercase and uppercase alphabets as variables and functions.
Digits
0123456789
Special Characters
Special Characters in C Programming
, < > . _
( ) ; $ :
% [ ] # ?
^ ! * / |
- \ ~ +
New Lines
The newline character (\n) is called an escape sequence, and it forces the
cursor to change its position to the beginning of the next line on the screen. This
results in a new line. To insert a new line, you can use the \n character:
Horizontal tab
The horizontal tab character (\t) is also an escape sequences and it forces the cursor to
give horizontal margin.
Carriage return means to return to the beginning of the current line without
advancing downward. This is commonly escaped as \r, abbreviated CR, and has
ASCII value 13
Form feed means advance downward to the next "page". It was commonly used as
page separators, but now is also used as section separators. (It's uncommonly used in
source code to divide logically independent functions or groups of functions.) Text
editors can use this character when you "insert a page break". This is commonly
escaped as \f, abbreviated FF, and has ASCII value 12
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.
For example:
int money;
do if static while
All these keywords, their syntax, and application will be discussed in their respective
topics.
C Identifiers
Identifier refers to name given to entities such as variables, functions, structures etc.
Identifiers must be unique. They are created to give a unique name to an entity to
identify it during the execution of the program.
For example:
int money;
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.