List of all keywords in C language
This tutorial provides a brief information on all 32 keywords in C language programming.
The auto is used to define a variable of storage class automatic.
- break and continue
The break statement is used to jump out of the innermost enclosing loop (while, do, for or switch statements) explicitly and pass control to next statement immediately following the loop. In other hands, continue statement is used to skip certain statements inside the loop.
- switch, case and default
The switch statement tests the value of an expression and test with the different “case” values. We can use “default” value if it doesn’t match any of “case” values.
The char keyword is used for indicating the variable is of the type character.
The const makes the value of a pointer or a variable UN modifiable.
- do and while
While and do are used for looping in C.
- double and float
The double and float are used for indicating floating type variables. Keywords float and double represent single precision and double precision floating point data respectively.
- if and else
If and else are used in decision making in C.
The enum is used to define enumerated type data type. Enumerated data type creates a set of constant of type int.
Keyword extern is used for indicating the variable is external and is declared outside every function and can be accessed by any function.
Keyword for is used for looping in C.
Keyword goto is used for an unconditional jump to a labelled statement inside that function.
The int is used for indicating the variable is of type integer.
- short, long, signed and unsigned
The short, long, signed and unsigned are type modifiers that alter the meaning of base data type to yield new type.
Here, the int type variable is modified to short int, long int, signed int and unsigned int respectively.
Keyword return terminates the execution of a current function and returns the value to the calling function.
sizeof is used to find the number of bytes of an object.
Variable of storage class register is much faster than normal variables.
Here, var1 is the variable of storage class register.
The static is used for indicating the variable is of storage class static. The value of the static variables persists until the end of the program.
Here, var is a variable of storage class static.
The struct is used in creating a structure which provides means to group different types of a variable under one name for easier handling.
Keyword typedef is used to explicitly associate a type with an identifier.
The union is used in creating a union which provide means to group different types of a variable under one name for easier handling.
The void is used to indicate that a function takes no arguments or returns no value.
The volatile is used to create a volatile object. A volatile object can be modified in an unspecified way by the hardware