Reserved keywords in C

Reserved keywords in C

In designing a compiler ‘C’ in a programming language, some words are reserved for specific tasks. These words are called keywords or reserve words. Each keyword has a definite meaning and this meaning cannot be changed. Along with this, another important thing to note is that all keywords should be written in lowercase. If this is not done then error will come in the program.

In simple terms, the words, which means “C” compiler has already been explained, are called keywords.

The following keywords or reserve words are used in the C language.

Keywords Common in C and C++

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

Keywords for C++ only

asm

false

protected

try

bool

friend

public

typeid

catch

inline

reinterpret_cast

typename

class

mutable

static_cast

virtual

const_cast

namespace

template

using

delete

new

this

wchar_t

dynamic_cast

operator

throw

 

explicit

private

true

 

Keywords Name

Description

asm

Used to write assembly language.

auto

Storage is a type of class. Which is also used for Local variable.

bool

The boolean variable is used to declare. for eg. True and False

break

Used to break loops or statements.

case

Switch case statement is to be used.

catch

Used to handle exceptions from throw.

char

The character variable is used to declare.

class

Used to declare classes.

const

Const This is used for a constant variable.

const_cast

The Constant variable is cast.

continue

Loop is iterated.

default

Switch is used for case statement.

delete

Used for dynamic memory allocation.

do

Is a loop type. With which the while loop is used.

double

floating-point is data-type.

dynamic_cast

Used with pointer.

else

The statement with if is used.

enum

Enumeration is the ‘Keyword’ of the data type.

explicit

Constructor convert करने के लिए इस्तेमाल होता है |

export

The definition of the template is exported.

extern

Storage is a type of class. Whose scope is global.

false

Boolean has a value.

float

Floating-point variable is used to declare.

for

Is a type of loop.

friend

non-member function; Used to access private data.

goto

There is a statement that contains a label.

if

Is a statement. Which shows whether the condition is true or false.

inline

is used for function.

int

The integer variable is used to declare.

long

The long integer variable is used to declare.

mutable

Is the type of a storage class.

namespace

The same idetifiers (variables, functions, classes) are used to tell differently.

new

Used for dynamic memory allocation.

operator

Used to declare overloaded operators.

private

Used to declare private members of a class.

protected

Used to declare protected members of the class.

public

Used to declare public members of the class.

register

Is the type of a storage class.

reinterpret_cast

The cast-type of Variable is used to change.

return

is used for function.

short

The short integer variable is used to declare.

signed

Is a variable modifier.

sizeof

The size of the variable is used to return.

static

Is the type of a storage class.

static_cast

There is a type_conversion.

struct

Structure is used to define or declare.

switch

Is a statement.

template

Used to write the Generic Program.

this

brings the pointer to the current object.

throw

Exception is used for handling.

true

Boolean has a value.

try

Exception is used for handling.

typedef

The data type is used to give alias_name.

typeid

Object is described.

typename

The alternative of class is

union

This kayword is assigned to its members at the same memory location.

unsigned

The unsigned integer variable is used to declare.

using

Used with namespace.

virtual

Runtime is used for polymorphism.

void

It does not return anything.

Author: E-Learning

We would be happy to hear from you about the topics you would like to read on this blog of ours. So, please don’t hesitate to contact us with queries, suggestions, feedback, etc.

Leave a Reply

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