C ++ data type and variable type ., Data Type Variable type

Source: Internet
Author: User

C ++ data type and variable type ., Data Type Variable type

Data Type

Numbers are free [not only belong to a certain type ]! But it can have different identities! Int, char, float, double, etc. It is stored in a memory location with different identities [storage rules!

Variable type

The memory number will not change. The change is to divide several bytes into a group and access the data according to the rules.

Int;

It means that a variable will be used in the future. This variable will occupy 4 bytes of space and use a to refer to the memory location and use int rules to access data.

Int a = 53;

Meaning: allocate a 4-bytes space in the memory, use a to refer to the memory location, and then use the int rule to access data. Next, determine if 53 is of the int type. If yes, the value is stored in the space according to the int rule. If not, it is not stored and discarded. The result is that the value 53 is int type data, store the value 53 in the memory according to the int specification.

[This code is divided into several steps. The calculator judges and executes the code step by step .]

Statement, just say, does not occupy the memory space;

Value assignment, occupying memory space;

 

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.