Keywords in C Language

69 Shares

List of all keywords in C language

This tutorial provides a brief information on all 32 keywords in C language programming.

  • auto

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.

  • char

The char keyword is used for indicating the variable is of the type character.

  • const

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.

  • enum

The 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 and 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 an unconditional jump to a labelled statement inside that function.

  • int

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.

For example:

Short var1;
longint var2;
signedint var3;
unsignedint var4;

Here, the int type variable is modified to short int, long int, signed int and unsigned int respectively.

  • return

Keyword return terminates the execution of a 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 is much faster than normal variables.

For example:

registerint var1;

Here, var1 is the variable of storage class register.

  • static

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.

For example:

staticintvar;
Here, var is a variable of storage class static.

  • struct

The struct is used in creating a structure which provides means to group different types of a variable under one name for easier handling.

  • typedef

Keyword typedef is used to explicitly associate a type with an identifier.

  • union

The union is used in creating a union which provide means to group different types of a variable under one name for easier handling.

  • void

The void is used to indicate that a function takes no arguments or returns no value.

  • volatile

The volatile is used to create a volatile object. A volatile object can be modified in an unspecified way by the hardware

69 Shares

Leave a Reply