C language Variables and function naming conventions

Source: Internet
Author: User

variable name rule
First Letter: LocalLGlobalG
A second letter:bit (BT) bool (b) char (c) int (i) short (s) long (L) unsigned (U) double (d) float (f)  pointer (p) enum (ST) struct (ST) union (ST)
example:

int liwidth;
struct person Gstperson;
Char Gcusedflag;
BOOL Gbisok;
Hump Naming method:MyFirstName、Mylastname,Such variable names look like Camel peaks.,So
and the name.
function name Rule
The function name should usually begin with a verb, ending with a noun, which conforms to the general rules of English.
Here are a few of the more appropriate functions to name:
Printreports ();
Spawnutilityprogram ();
Exitsystem ();
Initia|izedisk ();
The name of the addition _ after the classification word is as follows:
Stubaps_processevent ();
Stubaps_setinterpanchannel ();
Sampleapp_init ();
Sampleapp_processevent ();

C language Variables and function naming conventions

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.