C Tutorial

C-Keywords

In post C-Langauge , we understood that a Language must have some meaningful words created using symbols.The C Language also have some meaningful words ( also called keywords ).
Here’s a list of the standard C keywords categorised based on their usage :

Storage/Memory related keywords.

KeywordsUsage / Purpose
registerIt suggests compiler to store variable in a CPU register.
autoIt declares automatic variables (default storage class).
staticIt is used to declares a static variable.
externIt declares that a variable is defined somewhere else.
volatileIt tells the compiler not to optimize the variable.

Data type or size related keywords

KeywordsUsage / Purpose
charIt declares a character variable.
shortIt declares a short integer variable.
intIt declares an integer variable.
longIt declares a long integer variable.
long long It declares a long long integer variable.
floatIt declares a floating-point variable.
doubleIt declares a double-precision floating-point variable.
structIt declares a structure.
unionIt declares a union.
typedefIt is used to creates a new type name.
enumIt declares an enumeration.
sizeofIt returns the size of a data type or a variable.
voidIt is used specifies no return value or no parameters.
unsignedIt declares an unsigned variable.
signedIt declares a signed variable.
constIt is used to declares a constant value / Variable.

Loop related keywords

KeywordsUsage / Purpose
whileIt is used to starts a while loop.
doIt is used to starts a do-while loop.
forIt is used to starts a for loop.
continueIt is used to skips the current iteration of a loop.
breakIt is used to exits from a loop or switch statement.

Conditions related keywords

KeywordsUsage / Purpose
ifIt starts a conditional statement.
elseIt specifies the default path in an if statement.
else ifSpecifies the alternative path in an if statement
switchIt starts a switch-case block.
caseIt is used to defines a case in a switch statement.
defaultIt will specifie the default case in a switch statement..

Others

Keywords
Usage / Purpose
gotoIt transfers control to a labeled statement.
returnIt is used to returns a value from a function.

We will understand the usage of all these keywords in detail in comming posts. Please keep reading …! 😊

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Back To Top