Friday 13 November 2015

KEYWORDS

  • The keywords are reserved for specific meanings in C language
  • C has nearly 32 keyword
  • 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
autodoubleintstruct
breakelselongswitch
caseenumregistertypedef
charexternreturnunion
constfloatshortunsigned
continueforsignedvoid
defaultgotosizeofvolatile
doifstaticwhile
  • auto
    • 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.
  • 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 hand, continue statement is used to skip certain statements inside the loop.
  • switch, case and default 
    • 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. 
  • char
    • The char keyword is used for indicating the variable is of the type character. 
  • const 
    • const makes the value of a pointer or a variable unmodifiable. 
    • This value cannot be changed in program.
  • do and while 
    • while and do are used for looping in C. 
  • double and float
    • 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 
    • if and else are used in decision making in C.
  • enum : 
    • enum is used to define enumerated type data type. 
    • Enumerated data type creates a set of constant of type int. 
  • extern
    • Keyword extern is used for indicating the variable is external 
    • It is declared outside every function and can be accessed by any function. 
  • for 
    • Keyword for is used for looping in C. 
  • goto 
    • Keyword goto is used for unconditional jump to a labeled statement inside that function. 
  • int 
    •  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.
  • return 
    • Keyword return terminates the execution of current function and returns the value to the calling function
  • sizeof 
    • sizeof is used to find the number of bytes of an object.
  • register 
    • Variable of storage class register are much faster than normal variables
  • static 
    • 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 
    • struct is used in creating a structure which provide means to group different types of variable under one name for easier handling.
  • typedef 
    • Keyword typedef is used to explicitly associate a type with an identifier.
  • union
    • Union is used in creating a union which provide means to group different types of variable under one name for easier handling.
  • void 
    • void is used to indicate that a function takes no arguments or returns no value.
  • volatile 
    • 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