How to learn C language, a successful person's experience!

Source: Internet
Author: User

Today, I am able to claim to be a mixed it person, and to make a living, in the future we can make a living, Thanks to two people: Claude Shannon and John von Neumann, who discovered all the digital information, whether it was a program, an email, a movie that was coded in a series of 1 and 0, and they found out that we were able to use a pre-programmed program to control the machine and finish the action we expected it to complete. Suggest that everyone in the heart meditation three times their names, to show admiration. Of course, assuming that you come back to their time with the knowledge of today, there is no Turing award.
C language programming is our professional basic course, but the C language itself is a very powerful tool, it is the most widely used tools so far, and in the foreseeable future, it is still the people who convert into the heart of the program ape artifacts. What does this tool do? It creates a platform for communication between man and machine.
One day, you need to complete a 100 factorial job, so you moved to an up-to-date computer, installed the latest Windows Vista operating system, and then sat in front of it, shouting "feed computer, give me the factorial of 100", the computer said "OK, wait a moment"; , a plate of mushroom cabbage end up! Hehe, the computer is not waiter, you feed it it will not react, assuming you really wait a moment, I am afraid you will need to wait one more moment! 10,000 years later, people will call you "Lookout Cliff".
Since the computer is not supposed to be born and can't understand us, then how can we control it? If you give me a deaf ear, I will tell you to hang up at the end of the semester, oh, you immediately honest! For the computer, how can I do it, let it work for me? Yes, we have a powerful tool, C language!
OK, let's review the above scenario:
You want me to count 100 factorial, so I went to the computer room machine, wrote a program:
(add ppt ...)
Execute the program, OH, the results come out!
Some people think that today is the era of Java and. NET, who still need C and assembly? What is not known, Java and. NET is built on the software, is to monopolize the market and the establishment of the system, like digging a golden wall brilliant pit, please jump down, but also think of standing on the shoulders of giants, in fact became the frog in the pit bottom. To become a real program ape, and expect to become a program Ape master, must from the machine, from the CPU to the operating system, and then to the software system, master of the situation is enlightened after the mirror Lingtai, software design Superb, I am the program, the program is me.
After listening to my master of the situation, so you are very touched, said: I want to study hard, to master learning! The next day to buy a bunch of MFC, VB, Java and. NET books back, five o'clock in the morning up endorsement! This is not possible, the right way to get started only one, to pass the road, only this method! Students, starting with C language, try to learn C language!
Spectator John Doe said: This is stupid also! I use the mouse to drag a few controls, is a XXX management system, you use the C language afraid of a year can not write it! Well, I would like to admit that this is already the slave of MS, other I do not understand, MFC itself is a closed architecture, from MFC to learn, you will only form a closed thinking mode, because Ms hope that very many people just learn the surface of things, do not become a master, So it strongly recommends the so-called Visualization of the program development tools, there are really a lot of people willing to go to his when, and finally really lost direction. Said he could not sit the program, he can do, but the assumption that the program is a bit more complicated, when there is a fault, where the problem is not clear, anyway is not clear!
Liang Zhao Xin, Daniel, he said: "I do not understand, with the mouse how to hit the code it?" In my company, the master of the keyboard ring, the mouse occasionally ring, the novice is the mouse ring, the keyboard occasionally ring, their salary is not a difference of so much! ”
C language is the basis of the major operating systems, Unix, Linux, Windows its kernel is exclusively C language development, (some places are mixed with assembly language), you do not see the Windows API is the C language function interface? Unix/linux Most of the applications are C language development, Windows applications with pure API development is not much, mostly rely on some kind of application Framework, such as the so-called VC + +, in fact refers to VC IDE + C + + language + MFC ( Today the focus has shifted to ATL, WTL), but the underlying software, such as Windows services, networks, drivers, or C language has been developed. Compilers of various languages, including Java virtual machines, are developed in C. A variety of embedded devices, such as mobile phones, PDAs are also developed in the C language. C language has a long history, its content is not rectification teacher's "C Language Programming (second Edition)" The description of the narrative is so simple-the book is only for the Chinese national conditions of the introduction of teaching books.
students always like to ask: What kind of language is good? Learning that language has a future? Such questions are discussed every day, never ending. In fact, I think everyone is concerned about the language is more "money", learning that language after graduation can easily find a high-paying job-that's what I thought. Well, I tell you, if you are proficient in C, please go to Huawei, do not waste your youth in a small pond!
OK, listen to my earnest advice, you are ready to start from the C language, start climbing the program Ape master this mountain, before you start, you need to prepare in the luggage?
The first one to pack and move along with you is the "canonical format", there are a lot of textbooks, reference books, not too much attention to the problem of the format of the program, written out of the program like a heap of rubbish, which also led to the very many people now write the program has a lot of scrap code, garbage code, which is very much related to the entry of books, I'm going to take all the writers and hit pp. The real business process is absolutely normative, Zhang San write the program and John Doe program format roughly the same, the various identifiers of the naming rules, otherwise no one can understand the program you write. Assuming that the code written by anyone can not understand, it is absolutely rubbish. If you want to take those rubbish half a day, reluctantly to find out the gold, that such a procedure is not as good as to write again, so that the idea will be clearer. Therefore, the canonical format is the basis for getting started. What does the format of this specification contain? Many ah, to adhere to the ability to do! Long marker name, code indentation, a pair of curly braces no more than one screen, and so on.
The second one to pack is patience, so-called 工欲善其事, its prerequisite. It is impossible to succeed without a relatively dull process. It's not just that you have to be patient in your learning process, but also that there is one important aspect: the tuning program. Debugging is a key aspect of the process of tapping code, assuming that someone can write a program, OX, and is Daniel, not only Daniel, or I rode the green cow, mortals do not say! Debugging is the course that every program must experience. Often have classmates ask me: Teacher, my program is completely not wrong Ah, are copied according to the book Ah! How can you not execute it? I can not see this problem! You have a question to find me, to find other teachers, teachers to find who ah? Lee father? That's ridiculous! I just sit down to debug, this to tell the truth, debugging is very boring, so there are students complaining that I operate too fast, do not understand why to do so, why should that, my temper is not very good, a irritability will curse the ground, so, this requires you to cultivate their own internal strength!
With these two will be able to set off, it is expected that someone said, English and math do not? Everyone said that college students, such a problem do not ask! You have used morning and evening time to learn English, I do not want to go, computer professional English Super simple, elementary level, remember some professional vocabulary can be! About mathematics, say math good, knock code is good is no scientific basis! I have a classmate, Math Hui 100 points, knocking code is the extent of Hello world, but they are now a doctor of mathematics! Shame on me! As the university students, and is our professional college students, has been fully equipped with the code to knock the required mathematical quality! So this isn't what we're going to worry about, ready? Go!
What do you learn from the first trick? Hit the dog stick Method! Hehe
There was a great man who said: "repeated authority is the only way to mature", this is standing on the shoulders of giants, the first to learn the martial arts are all kinds of routines, such as evil sword, then talent mastery, open sect genre; we learn to hit the code to do this, this is a shortcut to help you go farther to the shortcut.
Read, watch the 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. : Of course, books should be optimistic, only good books are nutritious.to do a book broken million, programming like GodBoring reading is very depressed, very easy to become a fossil! Now very much is the book is to use the source code to explain the problem, the source code is like animation, like a slide, the book of moves one by one to see you. Can say Master's experience mostly originates from the code, finally also all turn into the source code exhibition now in front of everyone, put the book on the program one of the input (with the keyboard, with your fingers) to the computer, compile and execute. Their own manual input this step can not be omitted, now very many books have matching source code, very many students or adults to learn the time are clever, directly copy the source code in the past compiled execution, HoHo, this is no effect.
Naturally, I let you enter the program is not let you practice blind dozen, you in the process of input can product out of the program is good or bad, if you find yourself input a lot of repeated code, that at least the structure of the program is not good, poor change, change then pass, you want to improve it ah, it is not very well?
Of course, the program loses much, blind playing skill also on a step, the keyboard knocks fast, salary also follow up up! ^_^
Just, the keyboard knocks fast does not mean that your program is written well, otherwise the school just want each student to send a blind dozen contact software, four years after graduation, each is a program master!
Okay, you lost a program into the computer, exercise the hands of the muscle, also performed the results, pleasure of body and mind, this satisfied? That is far away from the master, to become a master, you have to exercise your brain muscles! Pick up your pen, pick up your paper, with your brain, this is known as the world's most sophisticated machine to execute the program you entered, record the values of different execution time variables, record the execution of the program branch, and finally found that the program was you dissected to the paper, I believe also dissected into your heart! This is the core of the shortcut, it is important to remember that the input program is not to say that the correct implementation of the finished, to read the code, using pen and paper as an auxiliary tool, make notes, this is the repeated authority, of course, if you are a genius, then please plug your ears, you are not within our scope of discussion!
Why is this a very important step?
When we first started to learn, is there a feeling, assuming that you write a program, where do you start? Front? Behind? Above? Following? In order to solve the problem, how should my program write? Scratching, so annoying ah, so simply go to bed, do not write, you see, such behavior is to hit PP!
Practice Martial Arts, always first repeated master's movements, talent has their own movements, so let us repeat the process of others to start, and then write their own program!
Following this approach, you will follow the organization to the road to Rome!
Next, you have to go, how do you get to Rome? Apply the program design method you have learned to the program you wrote!
One day, you see a problem here, you have the idea, how to do? Go on the machine, and fight the keyboard! Stop, stop! Pause, before the machine, do not forget your pen and paper, bravely put your ideas written down, if not written, do not go to the computer room wasted father and mother's hard-earned money!
Of course, you can not write Ah, write out of what is not to write it?practice is the only standard to test truth! Using your brain to execute one side, is not called "Human program Unity"? , that's it! Learn martial arts must learn the peerless martial Arts! Despite what is known as the most sophisticated, practical effect, the human brain still does not have the accuracy of the computer, assuming that your brain can be carelessly executed out, then OK, with the standard format and patience, go to the machine!
Naturally, we say all the while facing the character interface TC is somewhat depressed, everyone is accustomed to Windows, Microsoft's customer transformed design center is not blown out! How nice and colorful windows are. When you are practicing to my level, I have to listen to the Peking Opera to tap the code, of course, the integrated development environment under Windows. But for everyone, not now, Windows is very critical, the program ape or go back to TC!
TC has at least one advantage, able to exercise our habit of using a combination of keys, to exercise our habit of using keyboard programming, recalling what we have just said the beam said, "How to program with the mouse?" "Some students have to ask questions, I was born in the 80 's or even 90, you also let me face so boring input and output interface?" I have a generation gap with you! I look forward to a richer and more appealing way of interacting.
Oh, this question is well asked, C language also has graphics Ah, fully able to meet everyone's psychological and educational! Let's take a look at this program, very easy, that is, on the screen a period of time to get a sine wave!
(see ppt ...)
Is the effect of execution very good? When you learn the data structure, tree, figure ah, you can output ah, a lot of places you can do better!

Well, here we have basically conquered some of the methodological things in learning C programming, about the detailed learning process, assuming that you want me to tell you here how to learn the pointers? How to learn the function? I will not talk more than the content of the teacher, or open a topic called "How to learn Pointers", of course, if you would like to discuss with me the nature of pointers and advanced applications, after class, after class Ah!
Now, we're going to talk about one last question! Our professional ratio of girls to other engineering majors or higher, do not know why often to such as the following: 1, I am a girl, I am not suitable to knock code Ah, 2, my character is more outgoing, not suitable to sit down quiet knocking code!
Outgoing personality is not suitable for knocking code? You look at me, think I'm an introvert? Program apes also need divergent outward-looking thinking, old, the richest man on Earth said that he is more willing to recruit the ape-man who is learning physics, because the physical mind can from the Great (cosmic) to the smallest (atom). All, said extrovert is not suitable for knocking code words is lazy excuse, is to cover up his unspeakable purpose of the interface! Beat pp!
Why is it not suitable for girls to knock code? I know a reason, bad for the skin! If you look at my face, I know it! Besides, is there any other reason? British scientists have long proved that the difference between men and women is not exactly what people think, and that many women are more than men! Think of the former Matriarchal Society, now the Huian woman!
I've seen the development of a public company. Two ALL women! , from software project division to Hardware Project Division to department managers are women, performance is not lost in other research and development department, this company in Hunan, not my nonsense!
Students, ask everyone a question, "21st century what is the most expensive?" ", good, is a talent, so, I can responsibly tell you," Do not learn C language, the teacher very angry ", the teacher very angry, the consequences how AH? is very serious!
That's all, thank you!
Learning C is not a overnight thing, but it does not take 10 years to master it. How to learn and Master C language at the minimum cost is the subject of this article. Note that even the "minimum cost" is by no means a shortcut, but rather the shortest time to get the most harvest, The same time also means that you need to go through the hard process.

Read a good book if you want to read it, or you might as well not read it.

The first question facing all the people who have just started learning is: How to choose the textbook. A good beginning is half the success, and choosing an excellent textbook is a key factor in doing more with less. Unfortunately, the school will usually help you to designate a very poor C language textbook, and fortunately, you can choose again.
  The famous professor rectification a "C language program", which is said to have a circulation of more than 4 million, as far as I know, very many schools will recommend this book as a C language textbook. Although my name (Tan Haoyu) is only one word from the professor, I am very determined to black his book. The book is not for computer majors, but for other majors who need to test for a computer grade. The main disadvantage of this book is: The sample program is very unprofessional, can not teach you the design should grasp the way of thinking, the program style is not good, it will let you develop the habit of writing code, too many mistakes, have been pointed out the book hundreds of errors, there are no lack of key conceptual errors. Well, this book I do not want to say too much, is interested in you can Baidu a bit:)

Kernighan and Ritchie's "The C Programming Language" (Chinese Translation"C programming language")Classic Classics, but the old version of a lot of content is outdated, and today's standard C language is far from,we must look at the latest version number,Otherwise it's better not to look. In addition, even the most classic of the most authoritative books, there is no way to do everything, so handy a copy"C Language reference manual"is very necessary. "C Reference Manual" is "C", is a detailed description of C language standards, including the vast majority of C standard library function details, is the best standard C language Reference. Incidentally, the latest "C programming language" is revised according to the C89 standard, while the "C Language Reference manual" describes the C99 standard, the two may be some discrepancy, it is recommended to study according to C99 standards. There's a copy."C and Pointers",Writing is also quite good, English name is "pointers on C", especially emphasize the importance of pointers, is a characteristic of this book it. But this book is not very suitable for people who have just started to learn, if you have learned C language, there are some C language foundation but not very solid, then you can try this book. I believe that only if you understand the pointer, C language is no longer magical.

If you have eaten a C language textbook and want to go further, then there are two books you must see. First,"C Traps and Pitfalls" ("C Trap and defect"), a very thin booklet, the content is very very interesting. Note that this book was written more than 20 years ago, and that many of the flaws in the C language mentioned have been improved, but it is not a bad thing to be able to understand some history. Then you can challenge "Expert C Programming" (Chinese Translation"c Expert Programming"),The book, as its name, is a difficult book, and once you have read it carefully and thoroughly understood it, you can confidently write "Mastering C" on your resume.
Remember a principle, do not read the book you do not understand at the moment, it is a waste of life. If you do not understand, then you must be missing some essential basic knowledge. At this point, you need to carefully analyze what you need to add, and then go to the bookstore to find the books that tell the content. The basic knowledge after the completion of the back to learn, will be the real multiplier.

Second, unix/linux or Windows, this is a very big problem

Different programming environments can create different thinking programs for apes. Most of Windows's program apes rely on integrated development environments, such as visual Studio, while UNIX program apes love makefile and consoles. Obviously, the integrated development environment is easier to get started with, learning C on Windows, just a few basic visutal C + + toolbar button can start to write Hello, world!, and under UNIX, you need some basic knowledge of the console operation. Some people may think that the UNIX environment is more concise, but the power of habit is very big, everyone is very familiar with the basic operation of Windows, and in order to learn C language to install a UNIX system, it seems a little cost-effective.
For a novice who knows only the basics of windows and doesn't know anything about DOS, it's important to do something interesting and meaningful as soon as possible. Writing a small program in C is far more interesting than learning LS, cat and so on, and we have to focus on the C language itself, we have to temporarily ignore some things, such as the process of compiling links, makefile, and so on.

So I suggest that the person who has just started learning should be in Visual C + + 6.0 (not visualc++. NET) or Dev C + + as a basic learning environment, and never dwell too much on the IDE's use of skills, because you must turn to the UNIX environment in the future. Visual C + + 6.0 is easy to use and debugging is straightforward, but its default compiler does not support the C standard well, and dev C + + uses the GCC compiler to support C99 standards. By the way, very many university C language courses are still using the Turbo C 2.0 as an experimental environment, which is quite undesirable, the reason is that the TC 2.0 on the C standard almost no support, and the other is the TC 2.0 compiled program is 16-bit, This will cause great distress to understand the 32-bit program in the future (of course, using something like DJGPP can make TC 2.0 compile 32-bit programs, but that's too complicated).

When you finish learning a C-language textbook, you must turn to the UNIX platform to continue learning, almost all of the advanced C language Tutorials are UNIX-based (for example, "c Expert programming"). The process of change is painful, and you have to face a variety of complex commands that are completely different from the way the Windows platform thinks, but the pain is worth it. UNIX and C are symbiotic, Unix thinking and habits more in line with the C language of thinking and habits. Under UNIX, you can find countless good source code for you to read, you can easily view a library function online manual, but also to see the best code style (speaking of code style, I will write a detailed article).

It boils down to a phrase: Beginner C, the recommended Windows system and integrated development environment, and when you're ready to go to the "master" direction, turn to UNIX platforms first.

three, everything is ready, you are the East wind
The book has been selected, the environment has been configured, is so-called ready, just owe your own efforts. Please start from the preface of the book, carefully read the teaching materials at hand, very many people like to read directly from the first chapter to see, this is the wrong way. The preface is the author's general introduction to the whole book, and the author will generally tell you what basic skills are needed to read the book smoothly, which will help you to test whether your basic knowledge is already available. After reading the preface, but also to browse the folder, to understand the overall structure of the book, by the way to arrange a study plan.

Learn C language, must pay attention to every detail, the sample code on the book must personally knock it out, compile and execute the output is the same as the book said the same talent is a case of learning, if inconsistent, it is necessary to find the reasons for detail. Out of some examples of books, and you want to "create" some examples, such as learning operator precedence, can write several same expressions, in different locations with parentheses to see what different behavior, such as *p++ and (*p) + +, such as a = b = = c, (a = b) = = c and a = (b = = c) and so on. The sample you copied and the example after the transformation, as well as your own "creation" of the sample, should be carefully categorized to save, and to write a short gaze in the source code, explain the intent of the sample.

After the example is the problem, I suggest that the beginning of the study of the people to do all the exercises are done independently, and then compare the code of the answer, to see their own code is insufficient, and then try to change their own code. Very many people do not attach importance to the exercise, this is a great mistake, because the author will generally explain some important facts in the exercise, rather than simply examine the previous knowledge.

Maybe you think it's too slow to learn, in fact. Learn to be careful not to go back, and so you learn to find yourself in front of not clear, that is really worth the candle. Generally speaking, the whole book read, you should be finished thousands of lines or even tens of thousands of lines of code, whether it is intact copy of the book, or their own whim to write on, are continuing to learn a wealth of money in the future. Take my own example and read"Windows core Programming"(I only read 3/4 of the content), in addition to the code on the transcription, but also wrote a very wide variety of examples, a common 5574 lines (with the Use of UNIX WC tool statistics), after a few days, I can not remember the Windows system programming, but only to spend a few minutes to turn out the code to see, Will once again be clear on the chest. The so-called good memory is inferior to bad writing, this is the truth.

Meticulous reading, carefully copied the source code, the independent completion of the exercise and further experiments, and finally will all the code left to become their own experience and wealth, absolute hard, but also absolute multiplier. Of course, such a method is only suitable for learning skills that need to be proficient, assuming that you are not learning C, and you need detailed analysis of the situation.

In the end, there is a very, very important point not to mention-code style, which must be forced to imitate the best code style from the very beginning. Because the code style too important content too much, I will use a special article to discuss in detail, please pay attention toThe path of procedural apes--about code style.
The topic is about C language, in fact I want to talk about the program how to learn, or a little sentiment, here, I just want to cite a few people around the sample, to talk about the understanding of program learning

The first person to talk about me, I am interested in the program, is heard that the program can play games, at that time is in the first day, but borrowed a g-basic concise textbook, I then silly eyes.

Strange words, strange logic, are some of the Chinese translation of astronomy, headache for a good while.

However, there was no other deliberate come to see, I was holding the book all day, what methods have been tried, and even looked backwards, did not see what the plan, and no computer, just can not stop daring to imagine, and then full of doubts ...

Stop here, above said is My Learning style: always have to go through some twists and turns, blind toss a few, and then there will be accidental awareness-enlightened! I have not even seen a few people have me so stupid, now clear, I always start to think about things too complex, causing the dog bite the hedgehog embarrassing situation, but unexpectedly have unexpected harvest! But do not suggest that you imitate such a style, at least when chasing a girlfriend can not be so, life is a lot of opportunities to take over the moment, lost will never find back.

Now back, then by chance, I understand a line of code, is the print statement, at that time, the excitement was deadly, and carefully looked at the look at that, all of a sudden to understand a lot of things, like in the grabbing between what to hit, immediately between clairvoyant ....
Third day in school learned Foxbase, basically self-taught, I found a strange thing, I this person is out of the name of the memory is not good, however, the command in the back of the program is a photographic, to now remember very much, perhaps is interested in it, but also thanks to my computer teacher to provide me with the opportunity to free on the machine! Later I self-taught qbasic, four summer and learned a little C, then learn C encountered a lot of difficulties, at that time, we school room even C language, I just stuffy at home, a two Class C textbook, a matching exercise, all day a daze to think, put their brains when the computer CPU, sometimes into the dead loop, And sometimes it crashes completely. I spent more than 10 days reading a book, finished a subject, but the mind is full of doubts, because there is no chance of the machine practice, I have to rely on their own test and reasoning has slowly built a lot of theory, very proud and confident, but later proved that most of the mistake, I spent a very long time to correct, this is something. However, still that sentence destroy nothing, do not hinder. Like I now have a computer, all day in the internet in the sea, feel the fast food culture, for a long time did not calm down to think of something good.

High school also had a few computer classes, just busy coping with the college entrance examination, I will learn the program's intention to give up, to here I should say a person.
High school sat next to me a girl, her song star has basic, I occasionally brought up a few small program play, she saw very interested, amazingly, she just looked at 35 programs, listen to me to tell a few commands of the function, can be based on their own imagination to make small animation, she had never learned the program! I once doubted her IQ, but her program was so fast that it made my eyes stare a couple of times higher than I had in several situations! I used to wonder if my method was wrong and how the program should be learned ...
Flash to the university, I met another let me admire the person, as I am learning computer, he is occasionally see me in the animation, and then very interested, then began to self-study. He is surprisingly, pointers, structures, bit operations and so on, do not understand (not to mention algorithms and data structures), just learned three program structure, and now only learn C six months, they can make up the snake, Tetris, minesweeper, there are a lot of games called the name of the small game, and now in the black and white chess, I know that I did go a lot of detours.
How the program should be learned, for C, I think we should learn from the drawing.
There are two reasons.
first, the drawing program is very exciting, it can bring you a strong interest, which is the key to the learning process.
Second, the drawing program easy to get started, very handy truth, you can make very beautiful things come. There are so many things that you can launch yourself without even reading the textbook (I think the reasoning is very important and it is a necessary condition for self-study).
For example, to draw a circle, from the mathematical point of view, to determine a circle, just need to know its center (x, y) and radius r, then a circle is drawn out, circle (x,y,r);
Other analogy, then draw a three-dimensional, select cube, and then analysis, just to know two diagonal coordinates can be, turn over the textbook, not so, why? You may think that the computer screen is a plane, the theory of three-dimensional coordinates here, I am afraid it is not the simplest way. So it's supposed to be two planar graphics panning. Here is the question, how is the stereoscopic figure represented in the plane coordinates? Self-study slowly, very shallow things.
Want to make animation, imagine the principle of animation is only from a graphic change to have a graphic, different changes in the appearance of animation effect, then you can draw a, wipe, and then draw a new, and then change ...
Good math skills, from two to three-dimensional, from static to dynamic I think is very fast transition.
Detailed how to learn, you can find a few drawings of the sample, knocking on the computer, more than a few, slowly you will know what is doing, and slowly will make their own things.
But don't dwell too long here, learning to draw is just to help you get started easily (a lot of people are not getting started with C learning).
Come out of the drawing temporarily, you should lay the groundwork, here no longer repeat. Can learn while practicing, physics, mathematics textbooks, a lot of problems can be demonstrated by the program, to solve, try to do something more, this is more than you learn textbooks in the model is much stronger, only you have to experience the ability to know.
Speaking of C, I think that any friend who has learned it has the feeling that "let me rejoice and let me worry." "The joy is that the C language features very powerful, widely used, once mastered, you can confidently say to others," I am a computer master! , and it's easy to learn other languages later. The worry is that C language like "Shaolin Kung Fu" is generally broad and profound, too difficult to learn. In fact, I think C language is not "difficult (difficult)", only you can clear the idea, grasp its essence, then self-study C language is a very easy and fun thing. Today I will talk with you about how to learn C language or to learn C language from which aspects to start.
Learn some basic knowledge

A Background of C language

Personally, no matter what language you learn, you should first understand the background of the language you are learning, and can say its history.

C language belongs to a kind of high-level programming language, its predecessor is "ALGOL". Its founder is Brown · W. and Dennis · M. Leach. The C language comes with great limitations because it can only be used on UNIX systems. However, with the progress of science and technology, the development of computer industry, C language gradually divorced from UNIX. In 1987, the American Standardization Association developed the C Language International standard, referred to as "ANSI C", since then it became a widely used programming language. C language has a lot of advantages, basic has such as the following four points:

1. Both high-level language and low-level language strengths, belong to an intermediate language.

2. It is a structured programming language that is well suited for structured programming.

3. There are a wealth of data types, operators, and functions to choose from.

4. Interact directly with memory, making it easy to change, edit, and document other programs and documents.

Two Two different learning methods for two major languages

I have learned a lot of programming languages, such as: c,c++ (Extension of C language), QBASIC,VB (Basic visualization), Javascript,jscript, Vbscript,java,asp,foxpro,perl and so on, I practice the income, In fact, high-level programming language is divided into two major languages. All the way is a C-based programming language, such as: Javascript,java, and so on, such language in the function of the call, the writing of the program statement, the control of the loop is very similar. There are also all the way to basic-led programming language, such as: Foxpro,vbscript, such as the same language has similar function calls, program statement writing and loop control, but with the C language is different. So if you've ever started out of QBasic, it's best to wash your brain before you learn C, and never use your basic methods and ideas in C.

Speaking of which, I think we must have a perceptual knowledge of C language! Let's get a little more sublimated and touch it all the way. C language Learning must start from the following four points, that is to say, only you can master the four points of content, then basically done.
How to learn C language well
Someone asked me C language is not very difficult to learn, I said no, later asked more people, I started to write an article about how to get started in C language ideas.
In fact, C language is very easy, it is just a communication rules, a tool of expression, a container of carrying ideas, it is difficult to feel, I think is not accustomed to using computer features to consider the problem. This is like the Chinese people from the United Kingdom to settle in, although you have learned English, but that is only the imagination of the United Kingdom, and the reality of the United Kingdom is very far from the situation, so there should be a process of adaptation, that is, often said transition period or running-in period.
To get started as soon as possible to master the characteristics of the computer, the characteristics of the computer include:
1, the computer in the handling of the problem requires the full, will tell it all the possibilities. People can ignore things according to their habits, but computers do not. For example, to solve a two-time equation, we consider the problem is already default to a is not equal to 0, and even the B-square minus 4AC is also the default greater than or equal to zero. This is our habit, since there is a solution, we generally used to make it a real solution, so you do the program is usually not to consider these two conditions, but the computer does not, the computer is a well-known mental retardation. The computer has no human-like intelligent processing power, it is a faithful believer, regardless of what you think, it will carry out your command. Because of your habits, some people who are not practical, or those who do not intend to make mistakes, cause the computer to be at a loss sometimes. Very tired, even crash, error, cause your program is not successful, so you feel very difficult.
2, the computer requirements of the description of the program is accurate, no ambiguity. Human language has very strong randomness and two semantics. We usually talk, sometimes is some greeting, sometimes the logic can not be very clear, words can not only express the meaning, but also can express the meaning, people can be based on the environment and the other side want to express the meaning of analysis, and finally get the correct results, but the computer is very retarded, although it is very obedient, But he can not understand the ideas you express, will only be executed according to the instructions you gave, resulting in the execution of the alarm and error.
3, computer programming is required to have a very strong overall and logical, there is no problem of ups and downs. People's thinking has a very strong active and dormant period, the computer will not, it is always on standby. When people think about a problem, there is a lot of fun, but this is not the overall problem, but a part of it, so there is a piece of code to finish, it is not willing to write again, or feel very difficult, so it feels very hard.
The computer requires its owner, consider the problem to be comprehensive, all possible situations and processing to tell it, the need to learn calm, stable mentality, the need to communicate the statement must understand the meaning of a single.
How can you learn C language very quickly and get through the running-in period faster? C language of the grammatical rules of the memory understanding of course is indispensable, in addition to pay attention to the following aspects:
1, a good understanding of the concept of variables and functions, at least once again look back to the elementary mathematics. This is the foundation, otherwise it will be congenital, you learn better, also can not become a climate.
2, balance mentality, although can not do "not with the things happy, not with their own sorrow" level, but at least not impetuous, do not rush to haste, waste.
3, the cultivation of their own global consciousness, can not only small, but also large without outside, just do.
4, strictly in accordance with the program design process, do not jump off, unrestrained, no rules are inadequate surrounding area.
5, strive to improve their comprehensive quality. Procedure is the expression form of human thought, and it is the combination of people's thinking and language of dealing with problems. You are in direct proportion to the degree to which you know the objective. Assume that you do not understand the problem of processing, will not deal with, you can not write the program.
6, learn to communicate, more exchanges, mutual complementarity, the same time team cooperation is very important.
In short, the practice of genuine knowledge, more learning, more practice, more thinking, more exchanges, studious ability to study.

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.