In the C language, we have some special words with their set of special characters; these words are called keywords.
Keywords are reserved in C; they cannot be used for other purposes as if we cannot declare a keyword a variable or we cannot use it as a constant also
There are 32 reserved keywords in the C language. Let us have a look at some.
break | const | case | do | char | default | continue | auto |
else | float | enum | if | extern | goto | for | double |
long | short | register | static | return | sizeof | signed | int |
switch | unsigned | typeof | while | union | volatile | void | struct |
Special characters in C
In the C programming language, special characters have their special meaning, and they cannot be used for other purposes.
Some of the special characters used in c are
- #
- *
- =
- ;
- ,
- {}
- []
- ()
Preprocessor (#):
The preprocessor is used to transform the program before the compilation. Execution of the preprocessor takes place before compilation. The other name for preprocessor is “macro processor.”
The assignment operator
This operator is used to assign any value. The assignment operator is used for many purposes in the c program. We can assign the value to the variable declared.
E.g. a=10;
Here we are assigning the value 10 to the variable a.
Asterisk (*)
This special character creates a pointer variable.
Suppose we have variable a, then we can create the pointer to the variable as *a.
Semicolon (;)
You can use the semicolon to terminate the line. It is also called statement terminated in the c program; each line is ended with a semicolon.
In case we miss adding a semicolon at the end of each line in the program, then an error will be shown.
Colon (:)
This special symbol is used for the initialization of the list.
The comma (,)
If there is more than one statement, then you can use a comma to separate the statements, for example, separating parameters in function calls.
Braces{}
The opening braces to carry out some executions after finishing programming, you can use code-closing braces to close the code blocks and open the code blocks.
Parentheses()
You can use these parentheses in function parameters and in making function calls.
Brackets[]
You can use these brackets for array elements like
Single and multidimensional subscripts.
The table given below indicates the special characters and their respective meaning.
Special symbol |
Meaning |
*
~ ; |
Asterisks
Tilde semicolon |
!
$ # |
Exclamation mark
Dollar sign Number sign |
&
^ % |
Ampersand
Caret Percent sign |
)
(
|
Right parenthesis
Left parenthesis |
,
+ – |
Comma
Plus sign underscore |
.
/ \ |
Period
Slash backslash |
‘
“ |
Apostrophe
Quotation mark |