c++--Simple data types and Boolean types

Source: Internet
Author: User

I. Simple data types

Data types describe the amount of space an object occupies in the memory store, describing the range of data that an object can represent

and types. The commonly used data types in the C + + language are integer, real, and character (these 3 types are also known as simple numbers

Type), array type, Boolean type, enum type, struct type, common body type, pointer type, reference class

type and so on.

1. Shaping

Integral type according to the symbol, can be divided into signed integer and unsigned integer two categories, from the length division, can be divided into

General integer, short integer, and Long Integer Class 3.

2. Real type

The real type mainly includes single precision type, double type and long double precision type.

10, 010, 0x10, 10u, 10L, 10UL, 10F

3. Character types

In the C + + language, character type data is represented in single quotation marks.

'a', ' A', 'b','b', etc.

Defining character type data can use the Char keyword, for example: char chdata = ' N ';

Two. Boolean type

There are only two values in logical judgment, that is, true and false. Boolean type--bool is provided in the program to describe the truth and false values of logical judgments . The data type provides two values of true and false, that is, truth and false values. Boolean type data can be treated as an integer type, and true means that 1,false represents 0.

You can assign a Boolean type object to an integer type object in your program, or you can assign an integer type object to a Boolean type object.

Three. I have thick skin, if you feel OK, give me a kiss, right? (°?‵?′??)

c++--Simple data types and Boolean types

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.