I also want to learn C language-Chapter 3: C program data, data types and variables

Source: Internet
Author: User

Well! I read your comments just now! Very happy! I am the lead singer of an underground rock band! Sing and sing at ordinary times! Then, I feel very interested in the most computer programs recently! Then we decided to learn program design every day! Then! I searched for a program blog on Google and tried to take notes so that I could learn more seriously and learn more firmly! I think the program is like a note! If you don't understand it, you can search for relevant information! In the past two days, it took more than 1000 yuan to search for information. I bought VIP addresses for two forums. I read which tutorials my friends think the most about and which books I would like to read! I think this will make rapid progress! Let's study hard! Although I have just started, I think I will work hard for 2 years! Let the program and music dissolve! Let yourself know more and enrich your life in a limited time! I. Data and commands

In python learning, I know that the program has data and instructions! Data is equivalent to something, and commands are equivalent to how to do these things! Then build more complex things. However, data and commands are expressed in binary in the computer. How does the computer know which commands are used as data ?! I think this question is like a friend who asked me whether this song is rock or pop! If you think it is rock or rock, you think it is pop or pop. Hey! Of course, the computer may not be like me, or the program will not be able to run. I think the computer will certainly have a mechanism to ensure that he knows what the programmer calls it as data, what are commands! But now, I want to release this question first! In the future, I think I will know more about it! I would like to thank MIT's lecturers for reading many concepts about MIT's teaching videos.

Ii. Basic Data Types

Data! There are many types in C language. I think there is still a type of data! In this case, we can better understand what type of data we are working on! Because the computer is binary, the basic data type, that is, the length of the binary bit, varies with the data type. So, about int, char, float, and so on. No !!! The book says: int4 bytes, float4 bytes !!!!! Crash! There must be an error in my understanding just now! Oh! I will search for relevant materials again! Alas! It turns out that there is another data encoding problem: int and float have different encoding methods, although the number of bytes is the same! Alas! Code. I will check it again tomorrow! A lot of content !!!

Iii. Variables

Oh!What is a variable! When learning IDE VC6.0. There is a debugging function in it. You can view the variable address when you look at the debugging part. I will try it! Well, it is true that every variable has an address in the memory, so I can understand it like this! A variable is an alias of an address! Then, when the C language declares a variable, there is a data type before the variable name. That is to say, the difference between the variable and the address is that the variable has an extra explanation for a specific segment of the address data! Hey! This should be the case, so we can understand: Variable-address = variable type.

Then! There are many types of variables! In addition to the basic types, there are array, struct, And the C language that the teacher at the University of Petroleum said: pointer type! Alas! Learn it slowly! Go to the meeting! Dazzled!

Green Channel: Please follow my favorites to contact me

Related Article

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.