(reproduced) How to learn C language

Source: Internet
Author: User

one, how to learn C language
Many people do not know how to learn C language, often ask me the same question: How to learn C language? I am a teacher, has developed many years of the program, and many people just started, like the first computer language learning is C language. After these years of development, I deeply understand the C language for a program designer how important, if you do not understand the C language, you want to write the underlying program this almost sounds ridiculous, do not understand the C language, you want to write excellent and efficient Cheng this is almost impossible. Why is C language so important?
First: C language grammatical structure is very concise and exquisite, write the program is also very efficient, very easy to describe the algorithm, most programmers are willing to use C language to describe the algorithm itself, so if you want to make a contribution to the design of the program, you have to learn it.
Second: C language allows you to drill down into the bottom of the system, you know the operating system, which is not written in C language? All the WINDOWS,UNIX,LINUX,MAC,OS/2, no one inside and out, if you do not understand C language, how can you go deep into these operating systems? Let's not say you write their kernel programs.
Third: Many new languages are derived from C language, C++,java,c#,j#,perl ... Which one is not? Mastered the C language, you can say that you have mastered a lot of language, after a simple study, you can use these new languages to develop, this once again verified that C language is the important foundation of program design. Also, say a little more: even if the recruitment of programmers now, the exam is the C language, you want to join the IT industry, then must master the C language.
So how do you learn C language?
1: 工欲善其事, its prerequisite
Here are a few things to learn the C language must:
A development environment, such as Turbo C 2.0, which once occupied the majority of the DOS-era development process. But now in the Windows era, with the Turbo C has a sense of the aspect, the editing program is very laborious, and drag and drop, there is no function variable automatic induction function, query reference material is not convenient. It is recommended to use Visual C + +, although this thing is relatively large, but once installed, it is very convenient to use.
a learning tutorial, now a lot of C language textbooks, but recommended that you use the "C language Programming" rectification editor of the second edition of Tsinghua University Press, this book is very suitable for beginners, and the content is very subtlety.
In addition, there are a lot of auxiliary learning software, after all, now is the window era, learning software, not as we had learned, only reading to do the problem so old-fashioned. I recommend an "Integrated learning environment (C language)", the inside of the knowledge of the summary and routine explanation are very good, there is a question bank test environment, it is said that there are thousands of problems, and even a Windows Trubo C, beginners do not even install other compilers, you can practice programming, very suitable for beginners. There is a "C language learning system" software, but the feeling is only a question bank system, if you feel that the problem is not enough, may also try.
2: Sunflower Treasure
What is the best way to learn computer language? Answer Yue: Read the procedure.
Yes, reading a program is the fastest and best way to get started with the C language. Like me, learning new j#,c# and other languages now is no longer a way of holding books, but learning their routines. Of course, for beginners who have not learned any computer language, it is best to read the tutorial first, learn each chapter, you must carefully understand all the concepts of this chapter, and then do not miss all the examples mentioned in this chapter, and then carefully study the program until each line is understood, and then find a few programming topics, Preferably similar or the same as a routine, I try to write this part of the program has been read, do not think that the routine you have read, you can write and it the same program, absolutely not, do not believe you will try it, if not written out, do not worry, back to continue to study the example, think of why they do not write out, Then go to write this program, back and forth, until you extremely easy, congratulations, you are fast getting started.
3: The Pinnacle
The best way to write a program is to master a variety of solutions (data structures) and problem solving methods (algorithms).
is writing the bottom-level program a master programmer? Non-Also, write the underlying program, nothing but the structure of the hardware, and hardware and hardware is not the same, to give a chip to write the driver, is to master the various registers and combinations of this chip, and then write value read value, just that. This is just familiar with some IO functions. So what's the mastery of programming? How can you master programming? For example: You have 10 people in front of you, find a person called "Zhang San", What should you do? The first method: directly to these 10 people asked: "Who called Zhang San." The 2nd method: you ask each other "Are you Zhang San?" "Until the man who asks is Zhang San." The Third way: you go to ask one person, "you do not know Zhang San, point to me to see." Do not underestimate this problem, you said of course will choose the first method, yes congratulations to you correctly, because this method is the fastest, most efficient, but in the program design to find the best way to solve the problem and you use the means is to test a programmer programming level of an important symbol, and is not easy to achieve. The problem is similar to the data structures and algorithms: Map data structures, exhaustive lookups, and binary lookups. So mastering the data structure and some common algorithms is the inevitable way to the pinnacle. Finally, we recommend Min's "data Structure" Tsinghua University Press, I hope every one want to become a master programmer to study the book.
Second, language learning methods

Talk about my way of learning.
Learning, no matter how it is spoken or not, can eventually be learned. But others have learned 1 months, and you have 100 years to learn, it is not late? : So, learning is still about methods. The learning method is correct, with less effort, the learning method is not correct, and the work is more than half.
what is the shortest way to learn C language? My answer is to read a book. Written in the book, is written by the predecessors decades of experience, read 10 books, it is equivalent to learn from the predecessors decades of skill, then your internal strength will quickly rise 1. : Books, of course, should be optimistic about books, only good books are rich in nutrition. If you have spent 1 days reading a book, and the Knowledge of the book is new to you, but because the book is poorly organized, or deep enough, so that you get less nutrition, it is not as good as the study of the day's fast, this book is not worth watching. Learn C language to see those good books? I think first of all to the basic book to see solid, such as "C Language Classics" in the introduction of 4. (Although many of these books are out of print, I believe the electronic version is also very useful.) Besides, if you really want to see it, I'm sure you'll find a way to do it. These books will be read in a short period of time (for example, a month or two), depending on your base and perception. What do you want to see in the next book? I might as well make a few more copies. Bjarne Stroustrup's C + + programming language (the C + + programming Language) must be seen, the book in the definition of some of the basic concepts of C, than I have seen any other C language books are all, to be careful; Bjarne Stroustrup's C + + language design and evolution (the designs and Evolution of C + +) and David R.hanson's "C Language interface and implementation technology for creating reusable Software" (C Interfaces and Implaeme Ntations Techniques for Creating reusable software) Be sure to look at these two books about how to use C to implement exception handling, implement types of encapsulation and expansion of some of the high-level technologies that are often used in large projects. Other books, operating system to see, the compiler principle to see, the algorithm to see, the mode also to see. Read a broken million Juan, coding as God. In short, as in the "biography" in the Cloud: "The mindset, also, learn and know, The Times also, sleepy and learn the second also." "We can't always learn by being trapped, but to be able to do it without moving, and fodder first."
reading is the guide to learning, the book can introduce a clear concept, but the book is not the application of the details introduced to you, because the application is always tricks complex, changeable. Therefore, we want to be familiar with the tricks, know how to use the book, but also to read more source code. Linus to other people to answer questions, often said read the ****ing source code, and also in its text mentioned in the "Source code, no secret." "This is the motto of the master." The source code is like an animation, like a slide show, the book of moves one by one to you to see. It can be said that the master's experience is mostly derived from code. The source code and the same book, also want to look good, do not see bad. Here, I recommend looking at Linux kernel source code and Linux TCP/IP source code. These two sets of code are open source, at your fingertips. In addition, Andrew S.tanenbaum's "design and implementation of the operating system" (Operating systems:design and implementation), Maudeca Hu Himing, "Linux kernel source code scenario analysis", Jonathan Corbet,alessandro Rubini,greg Kroah-hartman co-authored "Linux Device Driver" (Linux devices driver,3e), W.richard Stevens "tcp/ IP detail (3), W.richard Stevens advanced Programming for the UNIX environment (illustracted programming in the UNIX environment, the new version adds Linux Kernel content), such as the book, the convenience of course is not seen, is written out. When I was in high school, I insisted on writing 6 hours a day, "data structure" and the arrangement, graph theory of the exercises repeated n times. Although it has been a lapse of five or six years, a lot of content has long been forgotten, but it has cultivated my strong coding ability and debugging ability, until now still have a great help to my work.
learn bogey too much, bogey impetuous, avoid quick-buck, bogey arrogant. Put the study plan longer, cultivate a good learning method, step by step slowly, can eventually become a master.

(reproduced) How to learn C language

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.