How do I learn C + +? To be a good C + + programmer

Source: Internet
Author: User

One, C + + language

If you have a poor foundation, it is recommended not to start learning C + + language, starting from C, the program has a preliminary understanding of the gradual. C-language books can buy a C primer Plus, some examples of the book through the keyboard to hit the compiler tool, and then step-by-line debugging to see the values of the various variables. Or add some printf statements yourself to output the value of the variable. So when you finish reading a book, you have the feeling of writing a small program.

Remember, do not lazy, do not knock code, self-thought, can read, or directly from the online copy. The price of laziness is to spend more time to learn, and finally have not learned to give their own confidence caused a huge blow, no longer want to learn the program.

Learn C + + or want to learn C + + can add QQ Group: 389318488, there are learning resources in the group

C language After reading a book, you can buy a C + + book to read. "C + + Primer Plus" Such a good book, because too thick, afraid you do not have the confidence to read. If you do not have the confidence, C + + books can first buy a book 300 pages or less to look at. "C + + Primer Plus" This classic thick good book, can be used as a direct reference to data, time can be seen slowly.

Still want to remind you, must put the example of the book knocked into the computer, single-step implementation. Do not copy from the Internet, be sure to step into the implementation.

After two books honed, it is estimated that you will have a more in-depth understanding of C + +, should be able to enter the actual combat.

Second, the application with the interface

Learn the C + + language itself, may not have any sense of accomplishment, after all, is the console of the program, always output a string of strings, all day to face the black box, the sense of accomplishment is not so cool. It would be cool to have a program with a UI interface.

Down on the personal ambition, if you take the Microsoft route, then you come down to learn MFC good, if you want to take the open source route, the open source cross-platform interface library is more.

General and Simple is the Wxwidget, the official website for www.wxwidgets.org/. After you download to see the specific example, the inside of the example program to hit your compilation tool inside, to debug, see the results of the operation, you can also try to modify the example, add buttons, Response button events and so on.

Learn C + + or want to learn C + + can add QQ Group: 389318488, there are learning resources in the group

Go to this step, congratulations, you can divert a small application, but also with the interface.

Third, the network application

Language understand, UI program will also, down to learn network, now that the program does not need networking ah, understand the network for you to understand a lot of procedures very helpful. But where does the Web application start?

Learn C + + or want to learn C + + can add QQ Group: 389318488, there are learning resources in the group

Let me tell you, from the UNIX network programming book, this book can teach you the underlying principles of network sockets, the above examples of good learning, and write a response server. Write a server-side, and then write a client. Server side Please be sure to learn Select this simple multiplexing model, so you can slowly into the inside Poll,epoll, IOCP and other models.

Iv. operation of files

All programs, basic will use the file read and write operation, Windows system has its own file operation API, such as CreateFile, DeleteFile, etc., please novice do not learn Windows file Operation API, novice please learn standard C language file operation function, Easy to learn and cross-platform.

Just a few functions, rinsed you also learned, fopen, fclose, Fread, Fwrite, fseek, Ftell just a few.

V. Deep understanding of the relationship between memory and pointers

As a C + + programmer, from the beginning of the first day of the learning program, it is necessary to fight the release of memory allocation. You must understand the relationship between memory and pointers. How to understand it, the old nine School of the "0 Basic Programming Series C language" in the hands of the part of the hand to roll back and forth, the code hit dozens of times even if it is almost.

Learn C + + or want to learn C + + can add QQ Group: 389318488, there are learning resources in the group

Six, carefully study the Apache source code

Program non-C + + program, not in particular, 3 years of work can be mountain, three years for a C + + program is a change from quantitative to qualitative process, three years of project combat experience, you can get access to a complete application needs to have the skeleton.

But at this stage you write code, may be full of bugs, will go down, run inefficient, and look back to the code written a year ago, you may feel sick, can not see. No matter, this feeling is every progressive youth will have. To improve their level of code, or like a master to learn.

You may have to ask, the level of the company's colleagues, the level of good people are not willing to tell me. No relationship, open source code is you like the best way to learn, open source code is a master left the practice of the secret, you look after you will suddenly feel enlightened, feel their level poor people too far.

Apache inside a lot of ideas are all programs are common, understand, many modules you can also directly to use. The use of the memory pool, the use of the thread pool, the encapsulation of the module structure, is of great practical significance to Apache. If you can get the Apache source to eat a thorough, every detail to understand why people want to do so, I can say to you, "Congratulations, you are not far from the legendary master." ”

Vii. cultivation of C + +

I said the basic is the cultivation of C, to cultivate C + +, but also to spend more than 3 years of Kung Fu, it is possible to practice as a C + + master. C + + is too profound, one of the most complex is the idea of generic programming, do not think that you can write a template class that the generic programming is just enough.

C + +, can be from the C + + encapsulated MFC, Wxwidget start, see how the master through the C + + language, packaging such a huge UI library, the application of a lot of C + + mechanism, the most typical is the polymorphic mechanism, there are many design patterns can be studied.

Learn C + + or want to learn C + + can add QQ Group: 389318488, there are learning resources in the group

Eight, deep research design mode

Design pattern is the soul of programming, is a general method, when you face a large project, how to design a flexible system, all system analysts should master the skills. In the research of design pattern, we should carry on the actual project.

The above with the small partners said so many methods and steps, whether adhere to the above method of learning, is a small partner can learn to become the key. Not only C + +, to do a good thing to learn the way there are a lot of things, can persist is the key.

How do I learn C + +? To be a good C + + programmer

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.