C + + Programming specification (constantly updated)

Source: Internet
Author: User
This article summarizes some of the lessons learned to make the compiled code more robust. 1. Do not conflict with system functions when defining classes/structs (especially when porting between different systems/platforms)

Sometimes it's okay to compile under windows, but not on Linux, because Linux has the same name function.

A little bit better the compiler will prompt: Must use ' class/struct ' tag to refer-type ' XXX ' in the this scope; an almost-perfect compiler can't find a type and throws a bunch of errors, which makes people feel confused.

There are two solutions at this time, one that you define yourself as a class or struct (which can be mixed) when you use it, and another way to get rid of the class name/struct name you define.

C + + Programming specification (constantly updated)

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.