C + + programming (iv)---code specification __linux

Source: Internet
Author: User

1. Variable naming specification

Scope Naming conventions

prefix Description
No Local variables
M_ Class membership Variable (member)
Sm_ Static member variable for class
S_ static variables
G_ Global variables
Sg_ Global static variables

Httpfile *_picreturnbuf-->httpfile *m_pstpicreturnbuf: Through m know this variable is class member, through P know is a pointer through St know this pointer is a structure body pointer

Variable prefix naming conventions

prefix Description
I Int
U unsigned int
L Long
Ul unsigned long
ll Long Long
Ull unsigned long long
F Float
B bool
Str String
Char Ch
P Pointer or Iteration child
Pst Pointer to structure body
Pp Double pointer
Pbuf Array

2. Function naming specification

3, development considerations

1). Pointer Processing & memory management

2). Error checking

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.