Which friend can help me think of a topic for a C language paper?
Speaking of C language, all the friends I want to learn have such a feeling, that is, "make me happy and make me sad." Fortunately, C language is very powerful and widely used. Once you have mastered it, you can confidently say to others, "I am a computer expert!" " "And it is easy to learn other languages by yourself in the future. Worryingly, C language is as extensive and profound as Shaolin Kung Fu, which is too difficult to learn. In fact, as far as the author is concerned, C language is not "difficult". As long as you can clear your mind and master its essence, it is very easy and pleasant to learn C language by yourself. Today, I'm going to talk to you about how to learn C language or where to start. Know some basic knowledge. The background of 1.C language is individual. No matter what language you learn, you should first understand the background of the language you are learning, and you can also talk about its development history. C language belongs to a high-level programming language, and its predecessor is "ALGOL". Its founders are Brown W. Kanihan and Dennis M. Leach. C language was very limited when it first came out, because it can only be used on UNIX systems. However, with the progress of science and technology and the development of computer industry, C language is gradually separated from UNIX. 1987, American Standards Institute formulated the international standard of C language, abbreviated as "ANSI C", which has since become a widely used programming language. C language has many advantages, mainly as follows: 1. It has the advantages of both high-level language and low-level language, and belongs to intermediate language. 2. It is a structured programming language, which is very suitable for structured programming. 3. There are abundant data types, operators and functions to choose from. 4. Directly processing memory makes it easy and simple to modify and edit other programs and documents. In fact, high-level programming languages are divided into two major language families. For example: C++(extension of C language), QBASIC, VB (visualization of Basic), JAVAs cript, Js cript, VBs cript, JAVA, ASP, FOXPRO, PERL and so on. All of them are based on C programming languages, such as JAVAs cript, JAVA and so on. These languages are very similar in function calling, program statement writing and loop control. The other is a programming language headed by BASIC, such as FOXPRO and VBs cript. This kind of language also has similar function call, program statement writing and loop control, but it is different from the C language family. So, if you started from QBASIC before, you'd better brainwash before learning C language, and don't apply the methods and ideas of learning BASIC to C. At this point, I think everyone must have a perceptual understanding of C language! Let's sublimate it and touch it in all directions. Learning C language must start from the following four points, that is to say, as long as you can master these four points, you are basically done. Close contact with c language 1. I/O C language is very strict in input and output. Maybe in other programming languages, we don't have to care about this problem, but in C language, we must understand it thoroughly. Due to limited space, I can't go into details. Interested friends can refer to the second edition of C Programming, edited by Tan Haoqiang, a famous programming language professor, and published by Tsinghua University Publishing House. But I still have a few points to say briefly here. 1. Input of two-dimensional floating-point number group Input of two-dimensional floating-point number group (that is, assigning values to two-dimensional floating-point number group through keyboard) has not been discussed in detail in many professional books. When assigning a value to a two-dimensional floating-point number group, you must first declare a variable, then assign a value to the variable, and finally assign a value to the two-dimensional floating-point number group. 2. Pay attention to whether the C language output of the characters after "%"in the output format is complicated, because the common ones are very simple. It may be said that it is not complicated, but it is not. I remember a professor who tutored us in C language once said, "If C language is difficult to test, there is no need to test any indicators at all. As long as the output format is specially tested, I think 99% of the students will fail. "At that time, we all agreed. From this example, we can see the complexity of the output format of C language. So when learning, you must learn to distinguish the characters after "%"in the output format. Each character has its meaning and function. 2. Priority When it comes to priority, many friends don't know it very well or are vague. To this end, I want to give you an idea through an example first. What is the priority? For example, when we queue up at the bus terminal, there will always be people over 70 who can get on the bus without queuing. This is the meaning of priority. When the C program runs, it's like queuing up for a bus. First of all, it takes care of operators with high priority. If the priorities are the same, it is like meeting two (or more) elderly people over 70 years old and letting them get on the bus in turn. However, the operation of priority in C language is not uniform. It can only be said that in most cases, the priorities of some operators have their own characteristics, and everyone should pay attention to this. For example, conditional expressions: conditions? Result 1: Result 2, as many friends know, its function is very similar to the IF…ELSE… conditional judgment statement, and the priority in operation is not completed according to the rules of C language. Therefore, programming enthusiasts must grasp the priorities flexibly and don't learn by rote. 3. Pointer Personally, the pointer in C language is the most distinctive and of course the most difficult to learn. After all, a pointer is actually an expression of a variable, but this variable records not a numerical value but an address. Just as a person can express himself by name, he can also express himself by ID number. I have been engaged in programming for more than three years, during which I received many emails from netizens asking how to learn pointers. Personally, I'd better learn some working principles of computer hardware, such as direct addressing and indirect addressing. Only by understanding these contents can you pay more attention to learning pointers. C language, after all, is a language between machine language and high-level language, and it is difficult to understand its true meaning without certain hardware working knowledge. However, everything is not absolute. It doesn't matter without this knowledge, as long as you know the following two points summarized by the author and practice more: 1. A pointer is an address variable: it has two values: one is the address and the other is the content. Different expressions can take different values, which is a bit like a home address identifying different people on different occasions. For example, the home address registered by parents in their company represents themselves, while the same home address registered by you in school represents yourself. 2. The pointer can be operated, and its algorithm is consistent with the variable. In addition, when writing programs, generally do not use pointer variables unless absolutely necessary. Because the pointer is more complicated, it will "crash" if it is not used well. Therefore, I suggest that as long as you can read the pointer, of course, if you are preparing for the exam, it is another matter. 4. Functions Although many programming languages have the contents of functions, I think the functions in C language are the most attractive. If you can fully master the functions of C language, then learning c++ is not a problem (c++ is a high-level programming language based on C language, but unlike C language, it adds many functions. )。 The method of learning functions is relatively simple, and there are only two words "remember", that is, remember the function, remember the purpose of the function and how to input and output. Some friends think that functions in programming languages are of little use, but this is actually wrong. Function is essentially a universal program, which can help us save a lot of programming time. Smart programmers always find out how many of their programs can be replaced by functions before writing programs. I have done an experiment to compare strings. The strcmp () function of C language only needs one sentence, but the 30 sentences written by itself are uneven. You can imagine how practical the function is!