Difference between Keyword and Identifier in C

Last Updated : 10 Jun, 2026

Keywords and Identifiers are the basic building blocks of a C program. Keywords are reserved words with predefined meanings, while identifiers are user-defined names used to identify program elements.

  • Keywords define the syntax and structure of the C language and cannot be used as names.
  • Identifiers are user-defined names given to variables, functions, arrays, structures, and other program elements.

Keyword

A keyword is a reserved word in C that has a special meaning predefined by the compiler. Keywords are part of the language syntax and cannot be used as identifiers.

  • Keywords have predefined meanings in the C language.
  • They cannot be used as variable, function, or class names.

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

Identifier

An identifier is a user-defined name used to identify variables, functions, arrays, structures, and other program elements. Identifiers help programmers give meaningful names to entities in a program.

  • Identifiers are created by programmers.
  • They must follow C naming rules and conventions.

Example:

studentName
calculateSum
age
totalMarks
employee_id

Keyword Vs Identifier

FeatureKeywordIdentifier
DefinitionA reserved word with a predefined meaning in C.A user-defined name used to identify program elements.
PurposeDefines the syntax and structure of the language.Names variables, functions, arrays, structures, etc.
Defined ByC LanguageProgrammer
Can Be ModifiedNoYes
Usage as Variable NameNot AllowedAllowed
MeaningFixed and predefined.Depends on the programmer's choice.
Number AvailableLimited and predefined.Unlimited (within naming rules).
Examplesint, if, while, returnage, salary, display(), studentName
Comment