Quick Start Guide to C Language Learning

Source: Internet
Author: User

Some people think that, in the era of java and. net, who needs C and assembly? Java and. net is built on software, and is built to monopolize the market. It is like digging a golden wall brilliant pitfall. Please jump down and think you are standing on the shoulders of giants, as a matter of fact, it is the frog at the bottom of the pit. To become a real programmer and want to become a programmer Master, you must start from the machine, from the cpu to the operating system, and then to the software system. the realm of the master is the bright mirror platform after the Enlightenment, software design is superb. I am a program, and a program is me.

Said Li Si, a bystander! I drag a few widgets with the mouse, which is a xxx management system. You can't write it in C language for a year! Well, I want to admit that all of this is mS's slaves. I don't know anything about it. MFC itself is a closed architecture. I should start with learning from MFC, you will only form a closed mode of thinking, because MS hopes that many people will only learn things on the surface and will not become masters, so it strongly recommends so-called visual program development tools, there are also many people who are willing to take the lead and finally get lost. He can do the same thing if he can't sit down with the program. But if the program is a little complicated, it will be hard to figure out where the problem occurs!

Liang zhaoxin, Daniel, said: "I don't understand. How do I write a program with the mouse? In my company, the keyboard of a master keeps ringing, the mouse occasionally rings, the mouse does not stop, and the keyboard occasionally rings, their salaries differ more than doubled! "

C language is the foundation of various major operating systems. The kernels of Unix, Linux, and Windows are all developed in C language. (in some cases, they are developed in combination with assembly languages ), do windows APIs use C function interfaces? The vast majority of Unix/Linux applications are developed in C language. There are not many Windows applications developed using pure APIs. Most of them rely on some ApplicationFramework, such as the so-called VC ++, in fact, it refers to VCIDE + C ++ language + MFC (now the focus has shifted to ATL and WTL). However, underlying software such as Windows Services, networks, drivers, and other software is still developed in C language. Compilers in various languages, including Java virtual machines, are developed in C language. Various embedded devices, such as mobile phones and PDAs, are also developed in C language.

The first option to move forward with you is "Standard Format ". Therefore, the standard format is the basis for getting started. What is the standard format? A lot of things can be done with persistence! Long identifier name, code indent, a pair of braces with a range of no more than one screen, and so on.

The second thing we need to do is to be patient. To do this, we must first sharpen our tools. To succeed, there is no relatively plain process. This not only means you must be patient and step-by-step in your learning process, but also an important aspect: Adjustment Program. Debugging is an important aspect in the process of writing a program. If someone can write a program at a time, it is a great cow, not just a great cow, but also a great ox riding by Lao Tzu, ordinary people cannot do this! Debugging is a process that every program must have experienced.

First, what should I learn? How to beat a dog! Haha

A great man said, "repetition of authority is the only way to maturity." This is the practice of standing on the shoulders of giants. The martial arts people must first learn a variety of routines, such as the Anti-evil method, then we can achieve integration and start the school of sect. We also need to learn to write programs. This is a shortcut to help you go further.

Reading books and reading good books! The book is written by the first ten years of experience. Reading ten books is equivalent to learning the skills of the previous ten years. Then, your internal skills will rapidly increase by 1. :) Of course, books should read good books. Only good books are nutritious. It is necessary to read books and programming. Reading boring books is depressing and easily becomes a fossil! Nowadays, many books use the source code to illustrate the problem. The source code is like an animation, just like a slide. I will show you the tricks in the book. Manually input this step by yourself cannot be omitted. Many books now have their source code. Many students or adults are clever at learning and directly copy the source code to compile and run it. hoho, this is ineffective.

TC has at least one benefit. It can exercise the habit of using key combinations and programming on the keyboard.

1. read a good book; otherwise, it is better not to read

Kernighan and Ritchie's TheCProgrammingLanguage (Chinese Translation of C programming language) is a classic, but many of the old versions are outdated and far from the current standard C language, you must check the latest version. Otherwise, it is better not to check it. In addition, even the most classic and authoritative books cannot cover all aspects. Therefore, it is necessary to keep a "C Language Reference Manual" at hand. The C Language Reference Manual is "CReferenceManual", which is a detailed description of the C language standard, including the details of the vast majority of C standard library functions. It is regarded as the best standard C language tool book. By the way, the latest C programming language is revised in accordance with the C89 standard, and the C Language Reference Manual describes the C99 standard, which may be somewhat different, we recommend that you follow the C99 standard. Another book, "C and pointer", is also quite well written. The English name is "PointersonC", with special emphasis on the importance of pointer. It is a feature of this book. However, this book is not very suitable for beginners. If you have studied C language and have some basic but not very solid C language, you can try it. I believe that as long as you understand the pointer, the C language is no longer mysterious.

If you have completed a C language textbook and want to go further, you must read two books. The first is CTrapsandPitfalls, a thin booklet with interesting content. Note that this book was written more than 20 years ago. Many defects in C language have been improved, but it is not a bad thing to understand some history. Then you can challenge ExpertCProgramming (Chinese Translation of "C expert programming"). The book is as difficult as its name. Once you finish reading it carefully, you can understand it thoroughly, you can write "proficient in C Language" on your resume with confidence.

Keep in mind that it is a waste of life instead of reading books that you cannot understand. If you cannot understand it, you must have some basic knowledge. At this time, you need to carefully analyze what you need to add, and then go to the bookstore to find the books about the content. After completing the basic knowledge, you can get twice the result with half the effort.

Ii. Unix/Linux or Windows, which is a big problem

Different programming environments will create programmers with different ideas. Windows programmers mostly rely on integrated development environments, such as Visual Studio, while Unix programmers prefer Makefile and console. Obviously, it is easier to get started with the integrated development environment. To learn the C language on Windows, you only need to write Hello, World by pressing several basic buttons on the visut1c ++ toolbar! In Unix, you need basic console operations. Some people may think that the Unix environment is more concise, but the power of habit is great.

Therefore, we recommend that you use visual c ++ 6.0 (not visual c ++. NET) or DevC ++ as the main learning environment, and never get too entangled in IDE usage skills, because you must switch to the Unix environment in the future. Visual C ++ 6.0 is easy to use and intuitive to debug, but its default compiler does not support the C standard, while DevC ++ uses the gcc compiler, the C99 standard is well supported. As mentioned above, many university C language courses are still using TurboC2.0 as an experimental environment, which is rather undesirable because TC2.0 has almost no support for the C standard, the second is that the program compiled by TC2.0 is 16 bits, which will cause great trouble to understand the 32-bit program in the future (of course, using djgpp and other things can make TC2.0 compile a 32-bit program, but that is too complicated ).

After you finish learning a C language textbook, you must switch to the Unix platform to continue learning. Almost all advanced C language tutorials are based on the Unix platform (such as C expert programming). The process of transformation is painful. What you need to face is a variety of complicated commands, which are totally different from the way you think on Windows platforms, but this kind of pain is worth it. Unix and C are symbiotic. The thinking and habits of Unix are more in line with the thinking methods and habits of C language. In Unix, you can find countless excellent source codes for your reading. You can easily view the online manual of a library function, you can also see the best code style (when it comes to the Code style, I will write an article to describe it in detail ).

To sum it up, we recommend that you use a Windows system and an integrated development environment when you are a beginner in C language. Please switch to the Unix platform first when you are preparing to work toward "master.

3. Everything is ready. You are Dongfeng.

The book has been selected, and the Environment configuration is complete. Everything is ready, and you only owe your efforts. Please read the teaching materials carefully from the preface of the book. Many people prefer to read the books directly from Chapter 1. This is a wrong practice. The preface is a general introduction to the entire book. The author generally tells you what foundation is needed to successfully read this book. This helps you to check whether your basic knowledge is ready. After reading the preface, you also need to browse the directory to understand the overall structure of the book and arrange a learning plan for yourself.

After the example is an exercise, I suggest that beginners do all the exercises independently.

Maybe you think it is too slow to study. If you learn carefully, you don't have to go back. After you learn it, you will find that you haven't figured it out before. This is really not worth the candle. Generally speaking, after reading the entire book, you should complete thousands or even tens of thousands of lines of code. Whether it's just a copy of the book or something you just write on your own, it's a fortune to continue learning in the future. For example, when I read "Windows core programming" (I only read 3/4 of the content), I wrote many examples in addition to the Code on the copybook, there are a total of 5574 lines (using wc tools in unix). After several days, I can't remember Windows system programming, but I just need to take a few minutes to read the previous code, then it will become clear again. The so-called good memory is not as bad as a pen, this is the truth.

Read carefully, copy the source code carefully, complete the exercises independently, and perform further experiments. Finally, you can leave all the code behind to become your own experience and wealth. It is absolutely hard, and you can do more with less. Of course, this method is only suitable for learning technologies that require proficiency. If you are not studying C language, you need to analyze the specific situation.

At the end of the article, there is a very important point not mentioned-the Code style. From the very beginning, you must force yourself to imitate the best code style. Because the code style is too important and too much content, I will use a special article to discuss it in detail. Please pay attention to "programmer's path-about code style".

Here, let's stop. What I mentioned above is my learning style: I always have to go through some twists and turns, and then I will have an occasional understanding! I have never even seen a few people who are so stupid as me. Now I understand that I always think too complicated at the beginning, leading to the embarrassment of a dog biting a hedgehog, however, there were unexpected gains! However, we do not recommend that you imitate this style. At least this is not the case when you chase your girlfriend. Many opportunities in your life are the moment you take over, and you will never be able to find them if you lose them.

Now I came back. By accident, I understood a line of code, which was a print statement. At that time, I was so excited that I read this line carefully. I suddenly understood a lot of things, like what was hit in the middle of the queue, the system immediately burst into the top ....

However, the sentence is still not broken. Just like I now have a computer, and I have been immersed in the ocean of the Internet all day. I feel the fast food culture and have never calmed down for a long time to think about something.

When talking about the C language, I think all the friends who have learned it feel like this: "It makes me happy and worries me. "I'm glad that the C language is very powerful and widely used. Once you have mastered it, You can confidently say to others," I'm a computer expert! ", And it will be easy to learn other languages in the future. The concern is that the C language is as broad and profound as "Shaolin martial arts", which is too difficult to learn. In fact, I think the C language is not "difficult (difficult)". As long as you can clarify your ideas and master its essence, it is very easy and fun to learn C language by yourself. Today, I will talk with you about how to learn C language or what aspects should I start.

In my personal experience, no matter which language you want to learn, you should first understand the background of your language, or the development history of it. C language is a type of advanced programming language, and its predecessor is "ALGOL ". Its founders are brown W. cancanal and Dennis M. LiQi. C language came out with great limitations because it can only be used on UNIX systems. However, with the advancement of science and technology and the development of the computer industry, the C language gradually disconnects from UNIX. In 1987, the American Standardization Association formulated an international standard for C language ("ANSIC"). Since then, it has become a widely used programming language. C language has many advantages, mainly including the following four points:

  1. It has the advantages of both advanced and low-level languages and is an intermediate language.
  2. It is a structured programming language and is very suitable for structured programming.
  3. A wide range of data types, operators, and functions are available.
  4. Directly dealing with memory makes it easy to modify and edit other programs and documents.

How can I learn C language well? To get started quickly, you must master the features of the computer, including:

  1. The computer must handle all the problems and tell all the possibilities.
  2. The computer requires that the program description be accurate and unambiguous.
  3. Computer programming requires strong global and logic, and there is no fluctuating problem.

The computer requires its owner to give full consideration to the problem. All possible situations and handling should be told that the computer should learn to be calm and his or her mentality should be stable. The communication statements must have a single meaning.

How can we quickly learn the C language and get through the trial period faster? Of course, it is essential to understand the syntax rules of C language. In addition, pay attention to the following aspects:

  1. Although the balance mentality cannot be "not happy with things, not sad with yourself", at least do not be impetuous, do not rush to seek success, speed is not up.
  2. Cultivate your global awareness, which can be both inner and inner.
  3. In strict accordance with the program design process design procedures, do not jump off, the sky is blank, there is no rule is not a square.
  4. Strive to improve their overall quality. A program is a form of human thinking, and a combination of human thinking and language. The extent to which you think of objective objects is directly proportional to the knowledge you have mastered. If you do not understand the problem you are handling, you cannot write a program.
  5. It is also important to learn to communicate with each other, communicate with each other, and complement each other.

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.