Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What are the classifications of C language?
What are the classifications of C language?
There are six basic data types in C language, which are:

Short integer long floating-point double character

In C language, data types are mainly divided into basic types, as well as structural types, pointers and void, among which the basic types and structural types are the most commonly used, so the concept may be a bit vague. In this way, the basic types include numerical types and character types that we are familiar with. Numerical types are the most commonly used, especially C Xiaobai, and numerical types include integer types and floating-point types. How to distinguish these two?

For example, 32 1, which has no decimal point, is called an integer, the corresponding number is 32 1.000, and the number with decimal point is called a floating point.

But even if it is an integer or a decimal, the computer has a number length that it can accommodate, so there are short integers and long integers, single precision and double precision.

Short integer: short integer

Long integer: long

Single precision: floating point

Double precision: double precision

These include:

The memory size occupied by short is 2 bytes; ;

The memory size occupied by int is 4 bytes; ;

Long occupies 4 bytes of memory; ;

The memory size occupied by float is 4 bytes; ;

The memory size occupied by double is 8 bytes; ;

The memory size occupied by char is 1 byte.

Naming rules:

1, try to prove variables in English, for example, sum can be used when giving and naming.

2. When naming, try to combine your own preferences. I may come back later to read your previous programs. Imagine that you don't know what this name stands for, and you don't have any comments. It looks like someone else's code.

3. Avoid using words that have been used by the system when naming, such as int double class.

4. When naming multiple words, try to capitalize the first letter of each word. Although it is complicated to implement, it is very good for aesthetics and readability.

5. i j k is generally used when naming circular variables, n m is generally used when naming general variables, and c ch is generally used when naming character variables.