Variable declaration variable declaration variable type classification

zhaozj2021-02-16  60

First, many friends who have contacted variables know what is variables, don't explain them.

Old rules, examples

#include

int main ()

{

Bool Senior; // Boolean variable

Senior = true; // set to true value

IF (Senior) // Judgment variable original book is test variable

Std :: cout << "----------------------";

Return 0;

}

Everyone seeing the above program, I don't have to ask me to explain it to you.

#include

The header file I do in the second lesson is not more than Luo.

int main ()

I don't know if I don't understand 1 lesson.

Bool seenior;

I want to say this, this is the Boolean variable, Bool is the declaration of the variable Senior tells you what type of variable this variable is if you don't understand this.

Int Senior;

This will always understand this understanding above and this is just a little just one.

Interty one is Boolean

Let me explain that the Boolean variable Boolean variable has two logic. He contains 2 values. One is a true (true). 1 and 0 of the value.

0 and 1 of a integer value can be converted to the true and false of the Boolean variable

0 is true for false 0

Uses: He usually uses the logic test to change the program process through the logic test

In the example, I refer to I can't explain here. This is the C language conditional statement is very fun statement, but I don't talk about it. I listen to me.

2, character type variable

People who are in the base process should know that characters should be 1, 2, 3 this is constant integer int

A.b.c This is what is the character to indicate that the variable is to represent a.b.c?

See here char We use this to indicate a variable is a character line.

This should don't use too much to explain too much.

3 WCHAT_T

This is the function of expanding char, but it is also a character type but more than 8 digits.

WCHAR_T data type is generally 16 digits

2 are keywords for characters variables

4 integer

I have a little ignored above is that it is not int a kind.

Integer variables can be symbolic unsigned long-term short integer and common type

I have a demonstration of the statement of a few middle and integer variables.

Long int

Long // 2 sentences are long integer integers

Signed Int

SIGNED / / symbol type integer

Unsigned int

Unsigned / / unsigned integer

Short int

Short // short integer

Unsigned short int

Unsigned short // No symbol short integersion

When defining special integers, as you can omit intimate

More specific you can master your own

Unregulated use unsigend short short long long, you can combine

Can be unsigned long integer or other other you need what you need to match

4. Floating-point my vernacular is to contact the decimal point

Clearly

I listed him out

Float // single precision

Double // double precision

Long double // long integer double precision

This is too simple for one of an understanding. You will be able to use it for you.

转载请注明原文地址:https://www.9cbs.com/read-13622.html

New Post(0)