Understanding of C language variables

Source: Internet
Author: User

1. Definition:

A variable is a contiguous storage space with a name. In the source code, you can request and name such storage space by defining variables, and use the storage space by the name of the variable. Below, let's understand how to define a variable. For example, to live in a hotel. First step, front desk registration: Live in a few rooms (data type);

The second step, take the room card (marked is the name of the room);

The third step is to stay in the room (get the corresponding storage space).

Add: Constants can look at the hotel's name, you can't change the name of the hotel at any time. This is true, and in practice it conforms to the corresponding data type.

2. Define the format:

Data type variable name 1,..., variable name n;

int A;

Char b;

3. Initialize:

Variables can be defined and assigned, or they can be assigned at the same time as defined, while assigning the initial value to a variable is called initialization.

4. Initialize the format:

Data type variable Name 1 = specific value;

  

Understanding of C language variables

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.