Today, I talked about the structure, and I first talked about the practice questions of several needles of the previous day before. Those topics are the chapters of the pointer in the old Tan book. Everyone will do it slowly, it is very important to master the pointer, learning programming is to practice more. Today I saw a very good article in the Internet, I post:
Sender: YCS830 (old goat), letter area: c
Title: Re: If you quickly learn C language
Learning C language is easy, it doesn't have a few statements, there are not a few functions. But it is another thing. As if
Huashan sword law is difficult to learn, so that the fox brother has studied several years, but no one will win. Separates to defeat only three
Trick, the fox brother is a few hours, but he first looked at all sent swords and fused
And the masters come back and forth.
Studying C is a process, I am now looking at C and ten years ago. Say that C is just one
Tools, the question is what you have to do, how to do it. C is good, I am like a kissone, you can look
Other swordsmanship. But Yue does not learn to have the effect of the fox rush.
Learning mathematics to logical thinking skills is a workout. Most of my math knowledge have also gave the teacher, but
Logical thinking is useful for programming. Summary, high generation, air solution as the basic class of mathematics system,
I am very useful in it. The C language is dead, the algorithm is alive, just like the khikikin, no trick - in combination
After the world swordsmanship.
What do you think? Think yourself slowly. Ok, now I will talk about today's topics, structures. Let's take a look at what is called struct. In fact, the structure is like records in the database, and the structure is equivalent to each attribute in a record. We are usually a whole, which is usually a whole. It's better than a student, and the students have his related properties, such as name, age, gender, class, and so on. Although multiple variables can be defined in the program, we represent these properties, so that one of them will not focus on a whole, so the C language takes into account this structure. Let's take a look at how to define a structure, as follows: struct student {char name [10]; char sex; int Age; ::}; / * pay attention, this semicolon is must be 喔 * / define one here is one Structural student, but this is definitely not defined a variable that can be called, which is just a structure, we have to define a variable of a structure, just like definition actually type: int A, b; and Struct Student A, b; all the same truth, just define a variable, the type is to look at the front. The same type can be defined, such as Struct Student * P; this is also correct (some of the structural arrays). This type of pointer is very important in the list you want to talk, then let's take a look at this structural pointer first. We can also point to the first address of this structure with a pointer: A.SEX = 'm'; this is the element operator in the most call structure. Struct Student * P; (* p). SEX = 'm' This is also the same here, but the structure has another well-expressed manner, and it is used to use another operation symbol->. P-> sex = 'm'; let's understand this expression, P is address, -> This is in this structure, p-> sex is pointing to the element in this structure. Time is very fast, I have not said much, I will get out of school. Ok, I don't have much to say, I am like this today.