Code for embedded software programming

Source: Internet
Author: User

1. Naming specification

To make variables better understood by other developers who read the code, you need to use a prefix

A (array), B (Boolean), I (4-byte integer), u (unsigned integer number), p (pointer), S (String), SZ (null-terminated string)

-For example:

BOOL Bflag;

int iCount;

Char Szname[name_len];

i,j,k,m,n,x,y,z single-letter variables are used at loop control and indexing, non-abusive • Local static variables must be prefixed with s_, such as S_bflag, on the basis of other rules. • Global variables must be prefixed with g_, such as: G_bflag If a variable is both a global variable and a static variable, it is necessary to use g_ because the global type is more important than the static type • If it is a struct variable, you can use Stru_ or st_, Depending on the situation, you cannot make the code look too long, but it is not easy to read

Code for embedded software programming

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.