C - Tokens

Tokens are the smallest meaningful units in a C program.

Learning Objectives

  • Identify different token categories.

Categories

  • Keywords
  • Identifiers
  • Literals (constants)
  • Operators
  • Punctuation (e.g., ;, ,, {})
// int - keyword; add, a, b - identifiers
// , - separator; { } - block delimiters; return - keyword
// + - operator; ; - end of statement
int add(int a, int b) 
{
  return a + b;
}