C Keywords

C keywords, identifier in C, Rules for writing an identifier in C programming

Every C-word is classified as either a Keyword or an Identifier, Keywords are predefined words in a C compiler.

  • There are 32 keywords in C language.
  • Each keyword is meant to perform a specific function in a C program.
  • All keyword have fixed meanings and these can not be changed.
  • C keywords cannot be used as names of variables, names for functions or as user-defined Identifiers.
  • All 32 C keywords are given below.
Keywords in C
auto break case char
const continue default do
double else enum extern
float for goto if
int long register return
short signed sizeof static
struct switch typedef union
unsigned void volatile while

Points about C Keywords

While using C keywords, always keep in mind the points listed below.

  • C keywords are case sensitive.
  • C Keywords are always written in lowercase.
  • A C keyword can’t be use as name of variables / identifiers.

C Identifiers

Identifiers refer to the name of user-defined variables, functions, and arrays.

There are many types of computers, for example, a laptop, desktop, supercomputer but simply we call them like this is a computer. In the same manner for the name of the variable, array, function, structure, etc. we say that this is an identifier.

  • These user-defined names consist of a sequence of letters and digits.
  • Lower-case and upper-case letters, both are allowed.
  • Underscore ( _ ) is also allowed.
  • Generally, we use underscore as a link between two words in the long identifier for example user_Name.

In above example first_Number, second_Number, and result are called as identifiers.

Rules for writing an identifier

  • The first character must be an alphabet or underscore.
  • Only letters, digits or underscores are allowed.
  • White space is not allowed.
  • C keywords can not be used as identifiers.
  • Maximum 31 numbers of characters are allowed in an identifier.

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

© 2023 GDATAMART.COM (All Rights Reserved)