[Reprint] If it is a beginner C language, please read the experience of some successful people

Source: Internet
Author: User



if it's a beginner C Please read the language the experience of some successful people


a column from enters upgradeable
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, they have discovered all the digital information, whether it is a program, an email, a movie is encoded in a series of 1 and 0; They found out that we can use a pre-programmed program to control the machine and make it do what we expect it to do. Suggest that everyone in the heart meditation three times their names, as a token of admiration. Of course, if you bring your knowledge back to their time, there will be no Turing award.
C language programming is our professional basic course, but the C language itself is a very powerful tool, it is so far the most widely used tools, and in the foreseeable future, it is still converted to programmers in the hearts of the 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 the computer, calculate 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 have reaction, if you really wait a moment, I am afraid you need 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 are deaf to me, I will tell you that you are dead at the end of the semester, oh, you are honest! How can I make it work for my computer? 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:
(take part in ppt ...)
Run the program, OH, the results come out!
Some people think that now is the era of Java and. NET, who still need C and assembly? I don't know, Java and. NET is built on the software, is to monopolize the market and the establishment of the system, as if to dig 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 programmer, and expect to become a master programmer, must start from the machine, from the CPU to the operating system, and then to the software system, the realm of the master is enlightened after the mirror Lingtai, software design Superb, I am the program, the program is me.
After listening to my master of the realm, 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 many people only learn the surface of things, not to become a master, So it strongly recommends the so-called Visualization of the program development tools, there are many people are willing to go to his when, finally really lost direction. Said he could not sit the program, he can also do, but if the program is a bit more complicated, there is a problem, 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 write the program?" 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 + +, actually refers to VC IDE + C + + language + MFC ( The focus has now shifted to ATL, WTL), but the underlying software, such as Windows services, networks, drivers, or C language has been developed. Compilers for various languages, including Java virtual machines, have been developed in C language. 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 "CLanguage Programming (second edition) as described in the simple--that book is just an introductory book on China's national conditions.
students always like to ask: What kind of language is good? Learning that language has a future? The question is discussed every day, never ending. In fact, I think everyone is concerned about, but that 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  don't waste your youth in a small pond!
OK, listen to my earnest advice, you are ready to start from the C language, began to climb the peak of the programmer master, before you go, you need to prepare in the luggage?
The first to pack in the bag with you forward is the "standard format", there are many textbooks, reference books, not too much attention to the problem of the format of the program, write the program like a heap of rubbish, which also led to many people write the program has a lot of scrap code, garbage code, and those books have a very big relationship, 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 is roughly the same, the various identifiers of the naming rules, or else who can not read the program you write. If the code written by anyone can not read, it is absolutely rubbish. If you want to turn those rubbish half a day, reluctantly to find out the gold, then this procedure is not as good as the re-written, so that the idea will be clearer. Therefore, the canonical format is the basis for getting started.what does the format of this specification include? A lot of ah, to insist on 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, you have to be gradual, and you're talking about another important aspect: the tuning process. Debugging is the process of writing a key aspect, if someone can write a program, cow, and is Daniel, not only Daniel, or I rode the green cow, mortal is do not Tao! Debugging is the process that every program must experience. Often classmates asked me: Teacher, my program is not wrong Ah, are copied according to the book Ah! How can you not run it? I can not see this problem! You have a problem you can find me, to find other teachers, teachers to find who ah? Lee father? That's ridiculous! I had to 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 on it, you can start, it is estimated that some people say, English and math do not? We all say college students, this kind of problem don't ask! You have used the 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, write program is good is no scientific basis! I have a classmate, Mathematics Hui 100 points, write program is Hello World degree, but people now is a doctor of mathematics! Shame on you! As the university students, and is our professional college students, has been fully equipped to write the process required mathematical literacy! So that's not what we're worried about, ready? Go!
What do you learn from the first trick? Hit the dog stick Method! Hehe
There was a great man who said: "repeating 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, and then to digest, open the sect genre; we learn to write programs like 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. : Books, of course, should be optimistic about books, only good books are rich in nutrition.to do a book broken million, programming like GodBoring reading is very depressed, it is easy to become a fossil! Now a lot of books are using the source code to explain the problem, the source is like an animation, like a slide, the book of the moves one by one to you to see. It can be said that the master's experience is mostly derived from the code, and finally all into the source to show in front of everyone, the book on the program one of the input (with the keyboard, with your finger) to the computer, compile and run. Their own manual input this step can not be omitted, and now a lot of books have matching source code, many students or adults learn to play smart, directly copy the source of the past compile and run, HoHo, this is no effect.
Naturally, I let you enter the program is not let you practice blind, you enter the process can be good or bad, if you find yourself entered a lot of duplicate code, then at least the structure of the program is bad, poor change, change then pass, you want to improve it ah, this is not very good?
Of course, the program loses much, blind playing skill also on a step, the keyboard knocks fast, salary also follow up up! ^_^
However, the keyboard to knock fast does not mean that your program is written well, otherwise the school as long as each student send a blind contact software, four years after graduation, all are the program master!
Okay, you lost a program into the computer, exercise the hands of the muscle, also run out of the results, happy 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 run your input program, record the values of different running time variables, record the running branch of the program, 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 operation is done, to read the code, using pen and paper as an auxiliary tool, make notes, this is the repetition of authority, of course, if you are a genius, then please plug your ears, you are not within our scope of discussion!
Why is this step important?
When we first started to learn, is there a feeling that if you write a program, where do you start? Front? Behind? Above? Below? In order to solve this problem, how should my program write? Scratching, very annoying ah, and then simply go to bed, do not write, you see, this behavior is to hit PP!
Practice Martial Arts, always first repeat Master's action, to have their own movements, so also let us re-repeat other people write the program began, and then write their own program!
Following this approach, you follow the organization on 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 out, 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! Use your brain to run one side ah, not called "Human program Unity"? , that's it! Learn martial arts must learn the peerless martial Arts! Although known as the most sophisticated, practical effects, the human brain is still no computer accuracy, if your brain can be so carelessly run out, then OK, with the standard format and patience, go on 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 cultivate to my level, I have to listen to the Beijing opera to write the program, of course, with Windows under the integrated development environment. But for everyone, not now, Windows is very dangerous, the programmer still go back to TC!
TC has at least one advantage, you can exercise our habit of using a combination of keys, we can exercise our habit of using keyboard programming, recall what we 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 very good, C language also has graphics Ah, fully can meet everyone's psychology of entertaining! Let's look at this program, very simple, is on the screen to talk a period of sine wave!
(see ppt ...)
Is the effect of the operation 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 basically solved some of the methodological things in learning C programming, about the specific learning process, if you want me here to tell you how to learn pointers? How do functions learn? 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, let's talk about one last question! Our professional ratio of girls to other engineering majors or higher, do not know why often to the following statements: 1, I am a girl, I am not suitable for writing programs AH; 2, my personality is more outgoing, not suitable to sit down quiet writing procedures!
Outgoing personality is not suitable for writing programs? You look at me, think I'm an introvert? Programmers are also very much in need of divergent outward-looking thinking, old, the richest man on earth, who says he is more willing to recruit programmers than to learn physics, because the mind of a physical person can be from a great (cosmic) to a very small (atom). All, say the extrovert is not suitable for writing programs is lazy excuse, is to cover up his unspeakable purpose of the interface! Beat pp!
Why is it not appropriate for a girl to write a program? 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 distinction between men and women is not exactly what people think, 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 engineers to hardware engineers 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 is very angry, "the teacher is 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 be proficient. How to learn and Master C language at the minimum cost is the topic 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,It 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 that all beginners face is: How to choose a textbook. A good beginning is half the success, choosing a good textbook is a key factor in doing more with less. Unfortunately, schools usually help you to designate a very poor C language textbook, and fortunately, you can choose again.
   The famous professor rectification out a copy of theClanguage programming, which is said to have a circulation of more than -million, as far as I know, many schools will recommend this book asClanguage textbooks. 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 example 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 TranslationtheC(programming language)Classic, but the old version of a lot of content is outdated, and now the standard C language is far from,we must look at the latest version,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 copytheCLanguage Reference Manual "is very necessary. The C Language Reference manual is "C Reference Manual", is a detailed description of the C language standard, including the vast majority of C standard library function details, is considered to be the best standard C language Reference. Incidentally, the latest C programming language was revised in accordance with the C89 standard, while the C Language Reference manual describes the C99 standard, which may be somewhat out of the way, and is recommended to be studied in accordance with C99 standards. There's a copy.theCand 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 beginners, 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 as long as you understand the pointer, C language is no longer mysterious.

If you have eaten a C language textbook and want to go further, there are two books you must see. First,theC Traps andpitfalls"(C Trap and defect), a very thin booklet with very, very interesting content. Note that this book was written more than 20 years ago and that many of the C-language flaws 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 TranslationtheCexpert Programming "),The book, as its name, is difficult, 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 present, it is a waste of life. If you do not understand, then you must be missing some essential basic knowledge. At this point, you have 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 big problem

Different programming environments can create different thinking programmers. Most programmers in Windows rely on an integrated development environment, such as visual Studio, and UNIX programmers 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 buttons will start to write Hello, world!, and under UNIX, you need some basic knowledge of console operations. 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 beginners should be in Visual C + + 6.0 (not visualc++. NET) or Dev C + + as the primary learning environment, and never dwell too much on the IDE's skills, because you will have to turn to the UNIX environment in the future. Visual C + + 6.0 is easy to use and debugging is straightforward, but its default compiler's support for the C standard is not good, and dev C + + uses the GCC compiler to support C99 standards. By the way, 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 TC 2.0 has little support for the C standard, the second 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 move on to the UNIX platform to continue learning, and almost all of the advanced C-language tutorials are based on UNIX platforms (such as "c Expert programming"). The process of change is painful, you need to face a variety of complex commands, completely different from the Windows platform thinking, but this pain is worthwhile. 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 excellent source code for you to read, you can easily see a library function of the online manual, you can 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 is configured to complete, so-called ready, only owe your own efforts. Please start from the preface of the book, carefully read the materials at hand, many people read like 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 foundation you need to be able to read the book smoothly, which can help you test whether your basic knowledge is already available. After reading the preface, but also to browse the table of contents, 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 book's example code must be personally knocked over, compile and execute output is consistent with the book said to be an example of learning, if not consistent, you need to carefully find the reason. Out of some examples of books, and you want to "create" some examples, such as learning operator precedence, you can write several identical 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 examples of the books that you copied and the examples after the transformation, as well as examples of your own "creations", should be carefully categorized and kept in a short note in the source code to illustrate the intent of this example.

After the example is the problem, I suggest that the beginner to all the exercises are done independently, and then against the code of the answer, to see their own code is insufficient, and then try to modify their own code. Many people do not pay attention to the exercise, this is a great mistake, because the author usually in the exercise to explain some important truth, rather than simply test the previous knowledge.

Maybe you think it's too slow to learn. 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 complete thousands of lines or even tens of thousands of lines of code, whether it is copied from the book, or their own whim to write on, are continuing to learn a wealth of future. Take my own example and readtheWindowsCore Programming "(I only read 3/4 of the content), in addition to the code on the transcription, but also wrote a lot of examples, a total of 5574 lines (with the Use of UNIX WC tool statistics), after a few days, I have not forgotten the Windows system programming, but just a few minutes to turn over the previous code to see, will be re-aware of the chest The so-called good memory is inferior to bad writing, this is the truth.

READ carefully, carefully copy the source code, the independent completion of the exercise and further experiments, and finally all the code left behind, become their own experience and wealth, absolute hard, but also absolute multiplier. Of course, this approach is only suitable for learning skills that need to be proficient, and if you are not learning C, you will need to specifically analyze the situation.

In the end, there is a very, very important point not to mention the 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 programmer's Roadabout the style of code.
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 the example of several people around, 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 tried, and even looked backwards, did not see what the plan, and no computer, can only keep on 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 understand, I always start to think about things too complex, causing the dog bite the hedgehog embarrassing situation, however unexpectedly has the unexpected harvest! But do not recommend that you imitate this 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 come back, then by chance, I understand a line of code, is the print statement, at that time the excitement is deadly, and carefully looked at this to see that, suddenly see 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, but then the command in the back of the program is a photographic, to now still remember a lot, 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 had to 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 machine practice, I rely on their own speculation and reasoning has slowly established a lot of theory, very proud and self-confidence, but later proved that most are wrong, I spent a 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 to soak in the sea, feel the fast food culture, a long time has not been quiet to think about something good.

High school also had a few computer classes, but 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 text in the star has basic, I occasionally brought up a few small program to play, she saw very interested, it is surprising that she only looked at 35 programs, listen to me to tell a few commands of the function, can according to their own imagination made 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 was when I was a few years old! I often think, is not the way I was wrong, the program should be how to learn ...
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 amazing, pointers, structures, bit operations and so on, do not understand (not to mention algorithms and data structures), only learned the three program structure, now only learn C six months, they can make up the snake, Tetris, Minesweeper, and a lot of the little name of the small game, and now in writing Othello, I know that I did go a lot of detours.
How the program should be learned,theCspeaking, I think we should learn from drawing.
There are two reasons.
first, the drawing program is very exciting, it can bring you a strong interest, this is the key to learning procedures.
two, drawing program easy to get started, very simple truth, you can make very beautiful things. There are a lot of things you can do without even reading a textbook (I think the method of reasoning is important, it is a necessary condition for self-study).
For example, draw a circle, from the mathematical point of view, to determine a circle, just know its center (x, y) and radius r, then a circle is drawn out, circle (x,y,r);
Other analogy, and then draw a three-dimensional, select the cube, and then analysis, as long as the two diagonal coordinates on the line, 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 just from one graphic to another, different changes appear 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 the transition is very fast.
Specifically how to learn, you can find a few examples of drawing, knocking on the computer, more than a few, slowly you will know what things are 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 textbook Many 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 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 C language features are 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 is like "Shaolin martial arts" generally profound, too difficult to learn. In fact, I think that C language is not "difficult (difficult)", as long as you can clear the idea, master 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, or the history of it.

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 a lot of 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 many advantages, the main is the following four points:

1. Both high-level language and low-level language advantages, 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. Working directly with memory makes it easy and easy to modify and edit 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 families. 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. The other way is in basic programming language, such as: Foxpro,vbscript, such as the same language has similar function calls, program statement writing and loop control, but is different from the C language. So if you have started from QBasic, then it is best to wash your brain before you learn C, and never use your basic methods and ideas in C.

In this case, I think we must have a perceptual knowledge of C language! Let's take a closer look at it and get a full touch of it. C language Learning must start from the following four points, that is, as long as you can master the four points of content, then basically done.
    How to learnClanguage
I was asked if C language is not difficult to learn, I said no, later asked a lot of people, I started to write an article about how to get started in C language ideas.
In fact, C is very simple, 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 the use of computer features to consider the problem. This is like the Chinese from the United Kingdom to settle in, although you learned English, but that is the imagination of the United Kingdom, and the reality of the United Kingdom is far from the situation, so there should be a process of adaptation, that is, often said transition 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 way the computer handles the problem requires a full, and will all probably have to tell it. 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 procedure is generally 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 have ulterior motives or who have no intention of making mistakes, cause the computer to be confused sometimes. Very tired, even crash, error, cause your program is not successful, so you feel very difficult.
2,the computer requires a precise description of the program, no ambiguity. People's language has a very strong randomness and two semantic nature. We usually talk, sometimes is some greeting, sometimes the logic of the speech can not be very clear, words can not only express the meaning, can also express that meaning, people can according to 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, only according to the instructions you gave to execute, which led to the execution of the alarm and error.
3, computer programming is required to have a strong overall and logical, there is no problem of ups and downs. People's thinking has a strong active and dormant period, the computer will not, it is always on standby. When people think about problems, there are a lot of things to enjoy, but this is not the whole problem, but part of it, so there is a piece of code to finish, it is not willing to write again, or feel very hard, so it feels difficult.
The computer requires its owner, consider the problem to be comprehensive, all possible situations and processing to tell it, the need to learn calm, the mentality of stability, the need to communicate the statement must understand the meaning of a single.
How to quickly learn C language, faster to spend the running-in period? 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 to look back at 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, in strict accordance with the procedure design process design procedures, 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. If 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, and teamwork is also very important.
In short, the practice of genuine knowledge, more learning, more practice, more thinking, more exchanges, studious to learn.
What is not suitable for the place also please advise!





[Reprint] If it is a beginner C language, please read the experience of some successful people


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.