C + + Learning Note 1

Source: Internet
Author: User
Tags naming convention
  • IFNDEF guarantees that the line code is only compiled once
  • C + + subroutine naming rules: several words in the first letter of the name, but first letter lowercase
  • The delegate type (typedef) naming convention in C + +: Capitalize other text-case blending in the first letter. Constant (define) naming rules: all uppercase.
typedef unsigned int Uint;
int BOOL; #define FALSE O; #define TRUE 1;
  • The naming prefix for Boolean variables/functions is
BOOL Ismybook; bool isboy ();
  • The scope of the local variable.

C89: Must be defined in front of the function, scope is from the defined position to the end of the function

C + +: The function body is defined arbitrarily, scoped from definition to end of block. So local variables can be duplicate names. When the global variable and the local variable are the same, the global variable is referenced by the: character.

C + + Learning Note 1

Related Article

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.