Home  >  Article  >  Backend Development  >  Explain C tags in C language

Explain C tags in C language

WBOY
WBOYforward
2023-08-30 22:01:091141browse

Explain C tags in C language

Tokens are generally the smallest, indivisible units in a C program and have different meanings.

Types of tokens

The various types of tokens in C are as follows -

  • Identifier - This refers to The name of a function, variable, array, structure, etc.

  • Operators - These symbols tell the C compiler to perform some logical, mathematical, or relational operation.

  • Special Characters - All characters except letters and numbers are called special characters.

  • Constants - Some fixed values ​​that cannot be changed during runtime of a program execution are called constant items

  • Keywords/Reserved Names - These are predefined words with some special meaning and cannot be used as variable names.

Example

The following is a C program using tokens -

#include<stdio.h>
int main(){
   int p, q, result;
   p = 2, q= 3;
   result = p + q;
   printf ("result = %d </p><p>", result);
}

Here,

  • main is the identifier .
  • {,}, (,) are delimiters.
  • int is the keyword.
  • p, q, result are identifiers.
  • main, {, }, (, ), int, p, q, result are together called tags.

The above is the detailed content of Explain C tags in C language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete