in C Plus Plus by
What are tokens in C?

1 Answer

0 votes
by

Tokens are identifiers or the smallest single unit in a program that is meaningful to the compiler. In C we have the following tokens:

  • Keywords: Predefined or reserved words in the C programming language. Every keyword is meant to perform a specific task in a program. C Programming language supports 32 keywords.
  • Identifiers: Identifiers are user-defined names that consist of an arbitrarily long sequence of digits or letters with either a letter or the underscore (_) as a first Character. Identifier names can’t be equal to any reserved keywords in the C programming language. There are a set of rules which a programmer must follow in order to name an identifier in C.
  • Constants: Constants are normal variables that cannot be modified in the program once they are defined. Constants refer to a fixed value. They are also referred to as literals.
  • Strings: Strings in C are an array of characters that end with a null character (‘\0). Null character indicates the end of the string; 
  • Special Symbols: Some special symbols in C have some special meaning and thus, they cannot be used for any other purpose in the program. # = {} () , * ; [] are the special symbols in C programming language.
  • Operators: Symbols that trigger an action when they are applied to any variable or any other object. Unary, Binary, and ternary operators are used in the C Programming language.
...