KEYWORDS
- The keywords are reserved for specific meanings in C language
- Keywords, combined with the formal C syntax, forms the C programming language
- The variables should not be named with any of the keywords as the meanings cannot be changed
- All the keywords are lower case letters
- Keywords are also called as reserved words
- All the keywords have pre-defined meanings
auto | double | int | struct |
break | else | long | switch |
case | enum | register | typedef |
char | extern | return | union |
const | float | short | unsigned |
continue | for | signed | void |
default | goto | sizeof | volatile |
do | if | static | while |
- auto is used to define a variable of storage class automatic.
- Variables declared within function bodies are automatic by default.
- They are recreated each time a function is executed.
- Since, automatic variables are local to a function, automatic variables are also called local variables.
- 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 hand, continue statement is used to skip certain statements inside the loop.
- The switch statement tests the value of a expression and test with the different "case" values.
- We can use "default" value, if it doesn't matches any of "case" values.
- The char keyword is used for indicating the variable is of the type character.
- const makes the value of a pointer or a variable unmodifiable.
- This value cannot be changed in program.
- while and do are used for looping in C.
- double and float are used for indicating floating type variables.
- Keywords float and double represents single precision and double precision floating point data respectively.
- if and else are used in decision making in C.
- 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
- It 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 unconditional jump to a labeled statement inside that function.
- int is used for indicating the variable is of type integer.
- short, long, signed and unsigned :
- short, long, signed and unsigned are type modifiers that alters the meaning of base data type to yield new type.
- Keyword return terminates the execution of 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 are much faster than normal variables
- 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.
- struct is used in creating a structure which provide means to group different types of variable under one name for easier handling.
- Keyword typedef is used to explicitly associate a type with an identifier.
- Union is used in creating a union which provide means to group different types of variable under one name for easier handling.
- void is used to indicate that a function takes no arguments or returns no value.
- volatile is used to create a volatile object.
- A volatile object can be modified in unspecified way by the hardware.
No comments:
Post a Comment