Beginner C language, please be sure to read the C language misunderstanding

C language programming is our professional basic course, but C language itself is a very powerful tool, it is the most widely used tool so far, and in the foreseeable future, it is still in the hearts of people who are converted into programmers. Artifact. What does this tool do? It establishes a platform for communication between people and machines.

One day, you need to complete a homework with a factor of 100, so you move to the latest computer, install the latest windows vista operating system, and then sit in front of it, shouting "feed the computer, give me the calculation The factorial of 100, the computer said "ok, wait a moment"; After a while, a plate of shiitake cabbage came up! Oh, the computer is not a waiter. If you feed it, it will not respond. If you really wait a moment, I am afraid you need to wait one more moment! Ten thousand years later, people named you "Wangfu Cliff."

Since the computer is not a waiter and can't understand us, how do we control it? If you pretend to be dumb, I will tell you that you are hanging at the end of the period, oh, you are honest! For the computer, how can I call it and let it work for me? Yes, we have a powerful tool, C language!

Please read the C language for beginners to avoid misunderstanding

Ok, let's review the above scenario:

You want me to calculate the factorial of 100, so I went to the machine room and wrote a program.

Run the program, oh, the result is out!

Some people think that now is the era of java and .net, who needs C and assembly? I don't know, java and .net are built on software. It is a system built for monopolizing the market. It is like digging a golden wall. Please jump down and think that you are standing on the shoulders of giants. In fact, it became a frog at the bottom of the pit. To become a real programmer, and to become a programmer master, you must start from the machine, from the cpu to the operating system, to the software system, the realm of the master is the mirror of the mirror, the software design is fascinating, I am the program, The program is me.

After listening to the realm of the master, I am very touched and said: I have to study hard and learn from the master! The next day I bought a bunch of books from MFC, VB, JAVA and .NET and came back at five o'clock in the morning! This is not the case, there is only one correct entry method, to prove the road, only this method! Classmates, start with C language and work hard to learn C language!

Bystander Li Si said: This person is stupid too! I use the mouse to drag a few controls, it is a xxx management system, and you can't write it in C language for a year! Ok, I have to admit that all these words are already slaves to mS. I don’t know anything else. MFC itself is a closed architecture. Starting from MFC, you will only form a closed mindset because MS hopes that many people will only learn the superficial things and will not become masters. Therefore, it strongly recommends the so-called visual program development tools. There are also many people who are willing to go to him and finally lose their way. He said that he can't sit on the program, he can do it too, but if the program is complicated, if there is a problem, it will be unclear where the problem is, and it is not clear!

Liang Shuxin, Da Niu, he said: "I can't understand, how to write a program with the mouse? In my company, the master's keyboard keeps ringing, the mouse occasionally rings, the novice is the mouse ringing non-stop The keyboard occasionally rings, and their salary difference is not doubled!"

C language is the basis of major operating systems. The kernels of Unix, Linux, and Windows are all developed by C language (some places are mixed with assembly language). Isn't the Windows API an interface for C language functions? Most applications of Unix/Linux are developed in C language; Windows applications use pure API development, but most of them rely on some kind of application work, such as VC++, which refers to VC IDE + C++ language + MFC ( Now the focus has shifted to ATL, WTL), but the underlying software such as Windows services, networks, drivers, etc., is still developed in C language. Compilers for 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 C language has a long history, and its content is not as simple as that described by Tan Haoqiang's "C Language Programming (Second Edition)" - that book is only an introductory book for China's national conditions.

Students always like to ask: What kind of language is good? Is there a future for learning that language? This kind of problem is being discussed every day, never ending. In fact, I think what everyone cares about is nothing more than a language that has a "money way". After studying that language, it is easy to find a high-paying job. I thought so. Well, I tell you, if you are proficient in C language, please go to Huawei, don't waste youth in the small pond!

OK, after listening to my bitter advice, you are ready to start from the C language and start climbing the mountain of programmers. What do you need to prepare in your bag before you leave?

The first one to be loaded with the capsule is a "standard format". There are many textbooks, reference books, and the problem of not paying attention to the format of the program. The program written is like a pile of garbage, which also leads to Nowadays, many people write programs that have a lot of scrap code, junk code, which has a very big relationship with those books that are getting started. They need to use those authors to play PP. The real business process is absolutely normative. The program written by Zhang San is roughly the same as the program format of Li Si. The naming rules for various identifiers are the same, otherwise no one can understand the program you write. If the code written does not understand anyone, it is absolutely junk. If you want to turn the garbage for half a day and barely find out the gold, then such a procedure is worse than not, it is better to re-write it, so that the idea will be clearer. So, the format of the specification is the basis for getting started. What is the format of this specification? A lot of it, you must persist to do it! The long identifier is named, the code is indented, the pair of braces does not exceed one screen, and so on.

The second thing to do with the capsule is patience. If the so-called workers want to do something good, they must first sharpen their tools. To be successful, no relatively dull process is impossible. This means not only that you have patience in the learning process, but also on the gradual progress, and that it is another important aspect: the pacing procedure. Debugging is an important aspect of the process of writing a program. If someone can write a program at once, it is a big cow, not only a big cow, but also the young cow that Lao Tzu rides. The mortal is not doing it! Debugging is the process that every program must go through. I often have students asking me: Teacher, my program is completely wrong, it is copied according to the book! Why can't I run it out? I can't see it for this problem! If you have any questions, you can find me, find other teachers, who are the teachers looking for? Master Li? That is ridiculous! I had to sit down and debug. To be honest, debugging is very boring, so some students complained that I was operating too fast. I don’t understand why this is the case. Why is it like that? My temper is not so good. So, this requires you to cultivate your own skills!

With these two, you can start. It is estimated that some people have said that English and math are not needed? Everyone says college students, don't ask this kind of question! You have already studied English in the morning and evening. I have no need to go. Computer professional English is super simple, and the elementary school level is just enough. Remember some professional vocabulary! Regarding mathematics, it is good to say that mathematics is good. There is no scientific basis for writing a program! I have a classmate, math back to 100 points, the program is also the degree of hello world, but people are now a doctor of mathematics! Oh! As a college student, and a college student of our major, I have fully possessed the mathematical literacy needed to write a program! So this is not something we have to worry about, Ready? Go!

The first trick, what to learn? Playing dog sticks! Ha ha

There is a great man who said: "Repetitive authority is the only way to mature." This is the practice of standing on the shoulders of giants. The first thing that martial arts people must learn is all kinds of routines, such as evil spirits. In order to be able to integrate and open the genre; we should learn to write programs as well. This is a shortcut to help you go further.

Read books, look at books! The book is written in the past ten years of experience. If you read ten books, it is equivalent to taking the skills of the previous ten years, then your internal strength will rise rapidly. :) Of course, books must be good-looking books, only good books are nutritious. To do a lot of reading, the programming is like God; the boring reading is very depressed, it is easy to become fossil! Nowadays, many books use source code to explain the problem. The source code is like an animation, just like a slide show. Let's take a look at the moves in the book. It can be said that the experience of the master is mostly derived from the code, and finally it is turned into the source code in front of everyone, the program on the book one by one input (using the keyboard, with your finger) to the computer, compile and run. I can't omit this step by hand. Now many books have supporting source code. Many students or adults are clever when they are learning. Copy the source code directly to compile and run, hoho, this is no effect.

Naturally, I let you enter the program is not to let you practice blind typing. You can make the program good or bad in the process of inputting. If you find that you have entered a lot of duplicate code, then at least the structure of this program is not good. If you are poor, you will change. If you change it, you want to improve it. Isn't that good?

Of course, the program has lost a lot, and the skill of blind play has also gone up a step. The keyboard is knocking fast, and the salary has also gone up! ^_^

However, if the keyboard is knocked fast, it does not mean that your program is well written. Otherwise, as long as each student sends a blind contact software, after four years of graduation, all of them are programmers!

Ok, you lost a program into the computer, exercised your hand muscles, and ran out of results, and enjoyed your body and mind. Is this satisfied? That is far from the master, to become a master, you have to exercise your brain muscles! Pick up your pen, pick up your paper, use your brain, this is the world's most sophisticated machine to run the program you entered, record the value of the variable at different runtimes, record the running branch of the program, and finally find This program has been dissected on paper, and I believe it is also dissected into your heart! This is the core of the shortcut. It is important to remember that the input program does not say that the correct operation is complete. You should read the code, use the pen and paper as an auxiliary tool, and take notes. This is the repeat authority. Of course, if you are Genius, then please plug your ears, you are not within the scope of our discussion!

Why is this step important?

When you first started learning, is there a feeling? If you let you write a program, where do you start? front? Behind? Above? the following? In order to solve this problem, how can I write my program? Scratching your ears, so annoying, so simply go to sleep, do not write, you see, this behavior is to play PP!

To practice martial arts, you must always repeat Master's actions in order to have your own actions, so let us repeat the procedures written by others, and then write your own programs!

Following this method, you follow the organization and embark on the road to Rome!

Next, you have to go, how can you go to Rome without going? Apply the programming method you learned to the program you wrote!

One day, you see a problem here, you have an idea, what should I do? Go on the plane and fight with the keyboard! Stop, stop! Pause, don't forget your pen and paper before you go to the machine, bravely write down your thoughts, if you can't write it, don't go to the computer room to waste your mother's hard-earned money!

Of course, you can't write it out. What about the things you write is not written? Practice is the only criterion for testing truth! Use your brain to run on one side, isn't it called "human program integration"? This is it! Learning martial arts is going to learn peerless martial arts! Although it is said to be the most sophisticated, the actual effect, the human brain still does not have the accuracy of the computer, if your brain can run sloppyly, then OK, bring the standard format and patience, go to the machine!

Naturally, we say that the TC facing the character interface is a bit depressed all day long. Everyone is used to windows. Microsoft's customer design center is not blown out! How good windows is, colorful. When you cultivate to my level, you must use the integrated development environment under Windows when you want to listen to this Beijing Opera. But for everyone, not now, windows is very dangerous, programmers still go back to TC!

TC has at least one advantage, you can exercise our habit of using the combination of keys, you can exercise our habit of using keyboard programming, recall what we just said Liang said, "How to program with the mouse?" Some students can not help but ask questions, I It was born in the 80s and even the 90s. Do you still let me face such a boring input and output interface? I have a generation gap with you! I look forward to a richer and more engaging interaction.

Oh, this question is well asked, there are also graphics in the C language, which can fully satisfy everyone's educational and entertaining psychology! Let's program, it's very simple, it's a sine wave on the screen for a cycle!

Is the running effect good? When you learn the data structure, the tree, the picture, you can output it like this, you can do better in many places!

Well, here, we basically solved some of the methodological things in learning C programming. For the specific learning process, if you want me to tell you how to learn pointers here? How to learn the function? Then I will not talk more than the content of the teacher, or open a topic called "How to learn the pointer", of course, if you are willing to discuss the nature of the pointer and advanced application with me, after class, after class!

Now, let's talk about the last question! The proportion of female students in this profession is still higher than that of other engineering majors. I don’t know why I often go to the following statement: 1. I am a girl, I am not suitable for writing programs; 2. My personality is more extroverted and not suitable. Sit down and write quietly!

Extroverted is not suitable for writing programs? Look at me, do you think I am introverted? Programmers also need divergent and extroverted thinking. Older than the richest people on the planet, he recruits programmers who are more willing to recruit people who are physics, because the minds of people who study physics can be enormous (the universe). To very small (atomic). All, saying that extroversion is not suitable for writing programs is a lazy excuse, an interface to cover up his ulterior motives! Hit the PP!

Why are girls not suitable for writing programs? I know a reason, it is not good for the skin! You see me, this is a vicissitude, you know! In addition, there are other reasons? British scientists have long proved that the difference between men and women is not exactly what people think, many women are more than men! Think about the former matriarchal society, now the Hui'an woman!

I have seen a research company's R&D department 2 all women! From software engineers to hardware engineers to department managers are all women, performance is not lost to other R & D departments, this company is in Hunan, not my embarrassing!

Classmates, ask everyone a question, "What is the most expensive in the 21st century?" Yes, it is talent, so I can tell you responsibly, "The teacher is very angry if he doesn't learn C language well," the teacher is very angry. What is the consequence? It is very serious!

That's all, thank you!

Learning C language is not a one-off event, but it does not take ten years to be proficient. How to learn and master C language at the least cost is the subject of this article. Please note that even the “minimum cost” is not a shortcut, but the most rewarding in the shortest time, but also means that you need to go through a difficult process.

First, read a good book, otherwise it is better not to read

The first question facing all beginners is how to choose a textbook. A good start is half the battle. Choosing a good textbook is a key factor in getting twice the result with half the effort. Unfortunately, the school usually gives you a poor C language textbook; fortunately, you can choose again.

The famous Professor Tan Haoqiang has published a book "C Language Programming", which is said to have a circulation of more than 4 million. As far as I know, many schools recommend this book as a C language textbook. Although my name (Tan Haoyu) is only one word difference from the professor, I am very determined to black out his book. This book is not for students of computer science, but for other professional students who need to take a computer grade test. The main disadvantage of this book is that the example program is very unprofessional and can't teach you how to think in programming. The program style is quite bad, and it will make you develop the habit of scribbling code. There are too many mistakes. I have pointed out hundreds of errors in this book, including key conceptual errors. Ok, I don't want to say too much about this book. If you are interested, everyone can Baidu :)

Kernighan and Ritchie's "The C Programming Language" (Chinese translation of "C programming language") is a classic classic, but many of the old version of the content is outdated, and the current standard C language is far away, we must see The latest version, otherwise it is better not to watch. In addition, even the most classic and authoritative book, there is no way to cover everything, so it is necessary to have a "C Language Reference Manual" at hand. The C Reference Manual is the C Reference Manual. It is a detailed description of the C language standard, including the details of most C standard library functions. It is the best standard C language reference book. Incidentally, the latest "C Programming Language" is revised according to the C89 standard, and the "C Language Reference Manual" describes the C99 standard. The two may be somewhat different. It is recommended to learn according to the C99 standard. There is also a copy of "C and pointer", which is quite well written. The English name is "Pointers on C", which emphasizes the importance of pointers. It is a feature of this book. However, this book is not very suitable for beginners. If you have studied C and have some basic C language but it is not very solid, then you can try this book. I believe that as long as you understand the pointer, the C language is no longer mysterious.

If you have finished a C language textbook and want to go further, there are two books you must watch. The first is C Traps and Pitfalls (Chinese translation of "C traps and defects"), a very thin booklet, the content is very, very interesting. One thing to note is that this book was written more than twenty years ago. Many of the C language flaws mentioned in it have been improved, but it is not a bad thing to know some history. Then you can challenge "Expert C Programming" (Chinese translation "C expert programming"), the book is as its name, this book is very difficult, once you read it carefully and can thoroughly understand, you can safely write on your resume "Proficient in C language".

Remember a principle, don't read books that you don't currently understand, it's a waste of life. If you don't understand, then you must have missing some necessary basics. At this point, you need to carefully analyze what you need to add, and then go to the bookstore to find books on the content. After you complete the basic knowledge and then go back to study, you will get twice the result with half the effort.

Second, Unix/Linux or Windows, this is a big problem

Different programming environments can create programmers with different thinking. Windows programmers mostly rely on integrated development environments, such as Visual Studio, while Unix programmers prefer Makefiles and consoles. Obviously, the integrated development environment is easier to use. To learn C language on Windows, you only need to press several basic Visutal C++ toolbar buttons to start writing Hello, World!, and under Unix, you need some console operations. Basic knowledge. Some people may think that the Unix environment is more concise, but the power of habit is very big, everyone is familiar with the basic operation of Windows, and it seems a bit uneconomical to install a Unix system for learning C language.

For a newcomer who only knows the basics of Windows and doesn't even know what DOS is, it's most important to do something interesting and meaningful as soon as possible. Writing a small program in C language is far more interesting than learning ls, cat, etc. Moreover, we have to focus on the C language itself, we have to temporarily ignore some things, such as the process of compiling links, the writing of Makefile, and so on.

Therefore, I suggest that beginners should use Visual C++ 6.0 (not Visual C++ .NET) or Dev C++ as the main learning environment, and don't be too entangled in the use of IDE, because in the future you must turn to the Unix environment. Visual C++ 6.0 is very convenient to use, debugging is also very intuitive, but its default compiler does not support the C standard, and Dev C++ uses the gcc compiler, which supports the C99 standard. By the way, many university C courses still use Turbo C 2.0 as the experimental environment, which is quite undesirable, because one of them is that TC 2.0 has almost no support for the C standard, and the other is the program compiled by TC 2.0. It is 16-bit, which will cause great trouble for 32-bit programs in the future (of course, things like djgpp can make TC 2.0 compile 32-bit programs, but that is too complicated).

After you have finished a C language textbook, you must turn to the Unix platform to continue learning. Almost all C language advanced tutorials are based on the Unix platform (such as "C Expert Programming"). The process of transformation is painful. You need to face a variety of complicated commands, which are completely different from the way of thinking on the Windows platform, but this pain is worthwhile. Unix and C are symbiotic, and Unix's way of thinking and habits are more in line with the way and habits of C language. Under Unix, you can find countless excellent source code for you to read, you can easily view the online manual of a library function, you can also see the best code style (saying the code style, I will write a special Detailed article).

To sum up, it is a sentence: beginner C language, it is recommended to use Windows system and integrated development environment, when you are ready to work toward the "master", please turn to the Unix platform.

Third, everything is ready, you are Dongfeng

The book has been selected, the environment is configured, and everything is ready. It only owes your own efforts. Please start from the preface of the book, carefully read the materials at hand, many people like to read directly from the first chapter, this is the wrong approach. The foreword is a general introduction of the whole book by the author. The author usually tells you what foundation is needed to read the book smoothly. This can help you test whether your basic knowledge is already available. After reading the foreword, you should also browse the catalogue to understand the overall structure of the book, and arrange a study plan for yourself.

To learn C language, you must pay attention to every detail. The example code in the book must be knocked out by yourself. The compilation and execution output is consistent with the book to be an example. If it is inconsistent, you should carefully find the reason. Out of the examples in the book, you have to "create" some examples, such as learning operator precedence, you can write several identical expressions, add brackets in different positions to see what different behaviors Such as *p++ and (*p)++, such as a = b == c, (a = b) == c and a = (b == c) and so on. The examples on the books you copied and the examples after the transformation, as well as examples of their own "creation", should be carefully categorized and written, and a short comment should be written in the source code to illustrate the intent of the example.

After the example is the problem, I suggest that the beginners do all the exercises independently, and then check the code of the answer, see if your code has those shortcomings, and then try to modify your own code. Many people don't pay attention to the exercises. This is a great mistake, because the author usually explains some important truths in the exercises, instead of simply testing the previous knowledge.

Maybe you think that learning is too slow, but it is not. If you learn carefully, you don't have to go back. When you learn later, you find that you haven't figured it out before, and that's really not worth the candle. Generally speaking, after reading the whole book, you should complete the code of thousands of lines or even tens of thousands of lines. Whether it is on the original copy of the book, or written by yourself, it is a fortune to continue learning in the future. For my own example, when I read "Windows Core Programming" (I only read 3/4 content), in addition to copying the code on the book, I wrote a lot of examples myself, a total of 5574 lines (using the wc tool under Unix) ), after a few days, I can't remember the system programming of Windows, but if I take a few minutes to look up the previous code, I will re-examine it. The so-called good memory is not as bad as the bad one, which is the truth.

Study carefully, carefully copy the source code, complete the exercises independently and further experiments, and finally leave all the code to become your own experience and wealth, absolutely hard, and absolutely more with less. Of course, this method is only suitable for learning the skills that need to be proficient. If you are not learning C language, you need to analyze the specific situation.

At the end of the day, there is a very, very important point that is 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 in detail, please pay attention to the "programmer's road - about code style."

The topic is about the C language. In fact, I mainly want to talk about how the program should be learned, or a little bit of insight. Here, I just want to quote examples from several people around me to talk about the understanding of program learning.

The first person has to talk about me. I am interested in the program. I heard that the program can be used as a game. At that time, it was in the first day. However, after borrowing a G-BASIC concise textbook, I was stupid.

Unfamiliar vocabulary, quirky logic, are astronomical Chinese translations, and it has been a headache for a while.

However, there were no other books to read at the time. I held the book all day, and I tried everything. Even after reading it, I didn’t see anything. I didn’t have a computer. Stop thinking boldly, then full of doubts...

Stop here, the above is the style I am learning: I have to go through some twists and turns, and I will make a few twists and turns, and then there will be occasional realizations - open! I haven't even seen a few people who are so stupid. Now I understand that I always think that things are too complicated at first, causing the dog to bite the embarrassing situation, but there are unexpected gains! However, it is not recommended that you imitate this style. At least when you are chasing your girlfriend, there are many opportunities in your life. The moment you take over, you will never find it when you lose.

Now come back, then by chance, I read a line of code, is a print statement, was so excited at the time, and carefully looked at this and looked at it, suddenly understood a lot of things, like what was hit in the 霎Like in the middle, immediately squatting. . . .

I learned FOXBASE at school in the third day, basically self-study. I found a strange thing. I am a famous person with bad memory. However, the commands in the back program were unforgettable. I remember a lot, maybe I am interested, and I am grateful to my computer teacher for giving me the opportunity to be free! Later, I learned QBASIC myself. I learned a little C in the summer of the fourth day. At that time, I had a lot of difficulties in learning C. At that time, our school computer room didn't even have C language. I had to slumber at home, a second-level C textbook. This supporting exercise, all day long daze, think of your own brain as a computer cpu, sometimes into an infinite loop, and sometimes completely collapse. I spent ten days reading a book and finished a problem. However, my head is full of doubts. Because I have no chance to practice on the machine, I have slowly established a lot of theory based on my own guessing and reasoning. Proud and confident, but later proved that most of them are wrong, it took me a long time to correct, this is a postscript. However, the sentence is still not broken, it does not stop. Just like I have a computer now, I spend all day in the ocean of the Internet, feeling the fast food culture. I haven’t calmed down for a long time to think about something.

I also had a few computer classes in high school, but I was busy with the college entrance examination. I decided to give up the program. I should say the next person here.

When I was in high school, I was sitting next to a girl. There was BASIC in her literary star. I occasionally took a few small programs to play. She was very interested in seeing it. Surprisingly, she only watched three or five programs. Listening to the functions of several commands, I can make small animations according to my own imagination. She has never learned the program before! I once suspected her IQ, but her program was so fast, but it made my eyes wide open for several laps, several times higher than I was! I often thought about it later, was it not my method at the time, how should the program be learned? . .

When I arrived at the university, I met another person who admired me. I learned computer like me. He occasionally saw that I was animating, and then I was very interested and started to teach myself. What is surprising to him is that pointers, structures, bit operations, etc., are not understood (not to mention algorithms and data structures). They only learned three kinds of program structures. Now they only learn C for half a year, so they can compile themselves. Snakes, Tetris, minesweeping, and a lot of little games that can't be named, and now I'm writing Othello, I know that I really took a lot of detours.

How should the program be learned? For C, I think it should be learned 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 the program.

Second, the drawing program is easy to use, and it is very simple to make beautiful things. There are a lot of things that you can roll out without even reading the textbook (I think the method of reasoning is very important, it is a necessary condition for your self-study).

For example, draw a circle, from a mathematical point of view, to determine a circle, just know its center (x, y) and radius r, then a good circle is drawn, circle (x, y, r);

Other analogies, draw a three-dimensional, select the cube, and then analyze, as long as you know the coordinates of the two diagonals, just flip the textbook, this is not the case, why? You may think that the computer screen is originally flat, and the theory of solid coordinates is here, I am afraid it is not the easiest way. So it should be two plane graphics translation. Here is the question, how is the solid figure represented in the plane coordinates? Study slowly, very shallow things.

If you want to make an animation, imagine the principle of animation is just changing from one graphic to another. If you change the animation differently, you can draw one, wipe it, and then draw a new one and change it. . .

If the mathematics is good, from 2D to 3D, from static to dynamic, I think it is a very fast transition.

How to learn specifically, you can find more examples of drawing, knock on the computer, knock a few more, slowly you will know what is doing, and slowly make things yourself.

But don't sink here for too long. Learning to draw first is just to help you get started easily (many people have not finished getting C).

Temporarily coming out of the drawing, you should play the foundation, and I will not repeat them here. You can practice while learning, physics, mathematics textbooks can be used to demonstrate, solve, try to do more things, this is much better than the model in your old textbook, only you can understand it yourself .

When it comes to C language, I think all the friends who have studied it have such a feeling, that is, "Let me make me happy." The joy is that C language is very powerful and widely used. Once you master it, you You can just say "I am a computer master!" to others, and it would be easy to learn other languages ​​in the future. The worry is that the C language is as broad and profound as the Shaolin martial arts. It is too difficult to learn. In fact, the author believes that C language is not "difficult", as long as you can clear your mind and master the essence of it, then self-learning C language is very easy and fun. Today, I will talk with you about how to learn C language or how to learn C language.

Learn some basics

one. C language background

As far as personal feelings are concerned, no matter which language you learn, you should first understand the background of the language you are learning, and you can also say its history.

The C language is a kind of high-level programming language, and its predecessor is "ALGOL". Its founders are Brown W. Carnihan 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 advancement of science and technology and the development of the computer industry, the C language has gradually separated from UNIX. 1987年美国标准化协会制定了C语言的国际标准,简称“ANSI C”,从此以后它便成为一种广泛使用的程序语言。 C语言的优点很多,主要的有如下四点:

1.兼备高级语言与低级语言的优点,属于一种中间语言。

2.它是一种结构化程序设计语言,非常适合结构化程序设计。

3.有较丰富的数据类型、运算符以及函数供以选用。

4.直接与内存打交道,使修改、编辑其他程序与文档变得轻松,简单。

two.二大语系二种不同的学习方法

笔者学习过很多程序语言,例如:C,C++(C语言的扩展),QBASIC,VB(BASIC的可视化),JAVA,J ,VB,JAVA,ASP,FOXPRO,PERL等等,就本人实践所得,其实高级程序语言分为两大语系。一路是以C为主的程序语言,例如:JAVA,JAVA等,这类语言在函数的调用,程序语句的书写,循环的控制都极为相似。另一路是以BASIC为首的程序语言,例如:FOXPRO,VB等,此类语言同样具有相似的函数调用,程序语句书写以及循环控制,但与C语系是不同的。因此若是您以前是从QBASIC起家的,那么在学习C语言前最好是先洗洗脑,千万不要把学习BASIC的方法以及思路用在C身上。

讲到这里,我想大家对C语言一定有了感性认识吧!下面让我们再升华一下,全方位亲密接触它。学习C语言必须从以下四点入手,也就是说,只要你能掌握这四点的内容,那么基本上就大功告成了。

怎样才能学好c语言

有人问我c语言是不是很难学,我说不是,后来问的人多了,我就萌生了写一篇关于c语言如何入门的文章的念头来。

其实c语言很简单,它只是一种交流的规则,一种表达的工具,一种承载思想的容器而已,之所以感觉难,我觉得是还不习惯使用计算机特点来考虑问题。这就好比中国人从到英国定居一样,虽然你学过英语,但是那只是想象中的英国,和现实的英国的情况还相差很远,所以要有一个适应的过程,也就是常说的过渡期或磨合期。

想尽快上手就得掌握计算机的特点,计算机的特点包括:

1、计算机在问题的处理方式上要求全,将所有的可能都要告诉它。人可以根据习惯忽略一些东西,但计算机不行。比如说求解一元二次方程,我们考虑问题就已经默认了a不等于0,更有甚者把b方减4ac也默认大于等于零了。这是我们的习惯,既然有解,我们一般习惯上就把它定为实数解,所以你做出来的程序一般是不考虑这两个条件的,但是计算机不行,计算机是有名的弱智。计算机没有象人一样的智能处理能力,它是人忠实的信徒,不管你怎么想,它都会执行你的命令。由于你的习惯,导致一些别有用心的人或者无意犯错的人来犯错误,致使计算机有时无所适从。很疲惫,甚至崩溃,报错,造成你的程序是不成功的,所以你感觉很难。

2、计算机要求程序的描述精确,无二义性。人的语言有很强的随机性和二义性。我们平时说话时,有时是一些招呼,有时说话的逻辑性可以不太清楚,话既可以表达这样的意思,也可以表达那样的意思,人可以根据环境和对方想表达的含义进行分析,最终得到正确的结果,但是计算机很弱智,虽然它很听话,但是他不能理解你表达的思想,只会按你交给的指令执行,这样导致执行时报警和出错。

3、计算机编程是要求有很强的全局性和逻辑性,不存在起伏的问题。人的思维有很强的活跃期和蛰伏期,计算机不会,它随时待命。人在考虑问题时,有很多尽兴的东西,但这不是处理问题的整体,而是一部分,所以就出现做完一段代码后,就不愿意再写,或感觉很吃力,所以感觉很难。

计算机要求它的主人,考虑问题要全面,所有可能的情况及处理都要告诉它,要求学会沉稳,心态要稳定,要求交流的语句一定要明了含义单一。

怎样才能很快的学会c语言,更快的度过磨合期呢?C语言的语法规则记忆理解当然是不可少的,除此之外还应注意以下几个方面:

1、好好理解一下变量和函数的概念,至少要重新回头看看初等数学。这是基础,否则就会先天不足,你学的再好,也成不了大气候。

2、平衡心态,虽然不能做到“不以物喜,不以己悲”的水平,但至少不要浮躁,不要急于求成,欲速则不达。

3、培养自身的全局意识,既能小无内,也能大无外,才行。

4、严格按照程序设计过程设计程序,不要跳脱,天马行空,没有规矩是不成方圆的。

5、努力提高自身的综合素质。程序是人思维的表达形式,是人处理问题思路和语言的结合体。你对客观看成到什么程度和你掌握的知识成正比。如果你对处理的问题不理解,不会处理,你怎么也写不出程序。

6、学会交流,多交流,相互补益,同时团队合作也是很重要的。

总之,实践出真知,多学、多练、多思、多交流,勤奋好学才能学成。

Ceramic Cap

ceramic cap

ceramic cap

YANGZHOU POSITIONING TECH CO., LTD. , https://www.cnchipmicro.com