Home >Backend Development >C#.Net Tutorial >Common keywords in c language

Common keywords in c language

下次还敢
下次还敢Original
2024-05-09 10:45:221141browse

Keywords in C language are predefined special words used for specific purposes. Common keywords include: data type (int, float, double, char), control flow (if, else, for, while, do...while, switch, break, continue), function (main, return, void), Scope (auto, extern, static, register), others (typedef, sizeof, const, volatile, struct, union, enum).

Common keywords in c language

Common keywords in C language

In C language, keywords are predefined words, has a specific meaning and may not be used for other purposes. The following are some of the most common C language keywords:

Basic data types:

  • int: integer
  • float: floating point Type
  • double: double precision floating point type
  • char: character type

##Control flow:

    if: conditional statement
  • else: optional part of the conditional statement
  • for: loop statement
  • while: loop statement
  • do...while : Loop statement
  • switch: Selection statement
  • break: Exit the loop or select statement
  • continue: Skip the remaining part of the loop

Function:

    main: the entry point of the program
  • return: return from the function
  • void: empty function

Scope:

    auto: local variable
  • extern: external variable
  • static: static variable
  • register: Register variable

Others:

    typedef: Create an alias
  • sizeof: Calculate the byte size of the data type
  • const: constant
  • volatile: volatile variable
  • struct: structure
  • union: union
  • enum: enum Lift

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

Statement:
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