dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Home » Tip Bank » C++
Language: C
Expertise: Beginner
Mar 16, 2004

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


A Convention for Naming Variables

Naming variables has a major effect on how hard it will be for a person to follow the code, whether it is the same person who wrote it or someone else. To avoid confusing others, many programmers use the Hungarian Naming Convention when naming variables. This way, variables of same type have the same prefixes.

Prefix		Type
f		boolean
ch		char
sz		zero-terminated string
fn		function
w		word
b		byte
l		long
u		unsigned word
bit		a single bit
v 		void
p		pointer
i		index to an array
h		handle
mp		an array
And so on...

Here are some examples:


char szName[40], *pchSex;
int uAge;
int fIsMarried;
int mpChildAges[4];
etc.
Raducanu Bogdan
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date