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

Explain C tags in C language

WBOY
Release: 2023-08-30 22:01:09
forward
1291 people have browsed it

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);
}
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template