Wuziqi gains (1)

Source: Internet
Author: User
Be sure to move the handwriting program!

In the afternoon and evening, the result is a baby of wuziqi. Although there is nothing to do, there are still many gains. The biggest achievement is that you must write the program. As Yang said, "Sometimes writing a program row is more useful than reading a book ten times." premature optimization is the root of all evil. Write the first version in the most stupid way and modify it later. It is a very bad method to "hide the pot on the stage". Writing programs should be done step by step.
New syntax gains: Virtual int Fuca () = 0; // three inheritance methods of pure virtual functions: class Dog: Public animal; Class dog: protected animal; Class dog: Private animal
Reference transfer: void setboard (chessboard & Board); // declare player. setboard (Board); // use macro definition: # define black 1 ;. H and. CPP: In. the function declared in H must be in. CPP. Otherwise, an error will be reported during connection (1) when creating the console program, select "hello, the World Program will automatically generate the main () function in the Program (2) when creating a new class, you can select the inherited parent class (3) to add a new method below, it is best to right-click the corresponding class and choose "add method" from the class design. (1) do not transmit pointers between classes. You can transmit references. (2) when designing objects, consider objects in the real world, because objects in the real world correspond to objects. To design better classes, we should abstract objects in the real world, find their most essential things, and get the corresponding classes. For example, the referee can be abstracted as a rule. (3) People also obtain computer data through interfaces, that is, the human-computer interface (GUI). Therefore, people and other programs can be viewed as receiving behaviors of the same type to some extent, but the specific implementation is not the same. (4) Pay attention to the quality of encapsulation when designing various classes.

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.