c++ Programming skills summary

  • 2020-06-15 09:50:23
  • OfStack

1. Treat C++ as a new language (it has nothing to do with C).

2. Read Thinking In C++, not C++ Programming Ideas.

3. Read The C++ Programming Language and Inside The C++ Object Model. Don't stop reading them just because they are difficult and we are beginners.

4. Don't be fooled by the terms VC, BCB, BC, MC, TC, etc. They are all integrated development environments (ides) and we are learning one language.

5. Don't pass up any seemingly simple questions about the site -- they're often not that simple, or they can point to a lot of points.

6. Just because you know Visual C++, doesn't mean you know C++.

7, it is not difficult to learn class, template, STL, generic programming is just so, the difficult is to practice for a long time and spare no effort to read widely.

8. If you're not a genius, you can't play games if you want to learn programming. You think you've done it, but your C++ isn't as good as your ability to complete it.

9. You can't learn C++ language by reading C++ books.

Impetuous people tend to say: XX language is not good, should learn YY; It's you, isn't it? The & # 63;

11, impetuous people easy to ask: I should learn what; Don't ask, just learn;

Impetuous people easy to say: I want the Chinese version! I can't speak English! - no & # 63; To learn!

Impetuous people tend to ask: XX or YY which is better; -- I tell you, it's all right -- as long as you learn.

There are two kinds of impetuous people: those who only watch and don't learn; All work and no play.

16, the fashionable technology on the lips, as well as the outdated technology in mind.

C++ supports more than just object-oriented programming languages.

One of the best ways to learn programming is to read the source code.

In any moment, do not think that the book in your hand is enough.

20. Please read The Standard C++ Bible (Chinese version: C++ Canon) and master C++ standard.

If you can read a book, please read it carefully. If you don't understand a book, please bite the dust.

Don't expect to remember or master something by reading it the first time. Please read it the second or the third time.

23. Please refer to Effective C++, More Effective C++ and Exceptional C++.

Don't stay in the cradle of an INTEGRATED development environment, learn to control the integrated development environment, but also learn to use the command line processing procedures.

Discuss meaningful C points with others, instead of arguing about whether XX is ok or whether YY is better than ZZ.

26. Please refer to "Programming Practice" and strictly follow its requirements.

27. Just because some of the syntax and keywords in C and C++ look the same, doesn't mean they have the same meaning and function.

If C++1 had started as Z, you would not have associated C with Z so closely.

Don't assume there will be any problems with learning C after you have learned the language. You are just learning a whole new language.

30, after reading Inside The C++ Object Model to determine whether you have learned C++.

The secret of learning programming is: programming, programming, reprogramming.

32. Please pay attention to the following books: C++ efficient object-oriented programming (C++ Effective ES137en-ES138en Software Construction), Object-oriented Software construction (ES141en-ES142en Software Construction), Design pattern (Design Patterns), The of Programming.

33. Remember that object-oriented technology is not just C++.

Please put the book's program examples into practice on the computer, even if the supporting CD has the source code.

35. Expand on the meaningful examples you see in the book.

36. Please pay attention to the exception handling technology in C++ and apply it to your own program.

37. Always look back at the programs you've written and try to rewrite them to put what you've learned to use.

Don't leave out any exercise questions in the book. Please complete all of them and record your ideas for solving them.

39, C++ language and C++ integrated development environment to learn and master at the same time.

Since you have decided to learn C++, please stick to it, because the purpose of learning programming languages is to master programming techniques, which are cross-language.

41. Let the various platforms and development environments of C++ compete fiercely. Let's focus on learning C++ itself.

42. When you write C++ halfway through the program and find yourself doing it in a poor way, don't stop immediately. Do the rest as quickly as you can to roughly complete the design, then analyze your mistakes and redesign and write (see 43).

43. Don't worry, designing C++ class is really not easy. class and class are improved and developed through continuous programming practice.

44. Just because a program is "small" doesn't mean it doesn't follow certain rules that you're not familiar with. Good habits are learned, not learned.

45. Every time you learn an C++ difficulty, try to explain the point to someone and get them to understand. Only if you can explain it clearly can you understand.

46. Write down the things you ignore or don't understand when communicating with others.

47, Please continue to write their own program higher requirements, even if your program version number will become Version 100.XX.

Save all the programs you've written. That's one of your best savings.

Please don't be impetuous.

Love C++!

Finally, Also want to say this sentence, study C++ please love C++!

1: Pointer variable names start with p, a common programmer habit when defining Pointers

2: har * p; int * p casts p to int type

3.1: Pointer problem: it is better to define (initialize) the pointer when it is applied so that the pointer can be grasped by the programmer.

3.2: Pointer out of bounds, this is probably the most difficult to find out!

3.3: Local variables of Pointers. Local pointer variables are automatically released by the program, and programmers reference such Pointers incorrectly.

. Application examples of 2d Pointers:


#include <stdio.h>

#include <string.h>

void sort(char (*client)[10]);

void main()

{

     int temp;

     char client[3][10];

     char (*pClient)[10] = NULL;

     for( temp = 0; temp < 3; temp++ )

     {

          gets(client[temp]);

     }

     pClient = client;

  sort(pClient);

     for( temp = 0; temp < 3; temp++ )

     {

          puts(*(pClient + temp));

     }

}

void sort(char (*client)[10])

{

     // A straightforward way of writing the bubble algorithm 

     int temp1, temp2;

     char temp[10];

   for( temp1 = 2; temp1 > 0; temp1-- )// Control every 1 The number of steps compared 

     {

          for( temp2 = 0; temp2 < temp1; temp2++ )// Compare pointer 

          {

              if( strcmp (*(client + temp2), *(client + temp2 + 1)) )// Compare the process 


Related articles: