Default
Google

Variables: Naming Variables

Applies To: C++Builder 1 or higher
Category: C++ Language

Variable names must respect the following rules:
 
 1.
  The variable name can contain only letters, digits and _
 
 2.
  The variable name can't start with a digit.
 
 3.
  C++ keywords or already existing functions cannot be used

      variable names.
 
It is important to note that variable names are case-sensitive. For example, number and Number are two different variables. You cannot use spaces in a variable name. To represent the name Courier New, you can use courier_new, CourierNew or another combination which follows the rules mentioned earlier.
 
Different conventions exist on how to name variables. The most popular is the Hungarian notation according to which you must include the first letters of the type name before the variable name. For example, to name a handle of a window called Window, you can use hWindow. The C++Builder VCL often uses this notation. To specify the color Blue, you must use clBlue.

C++Builder Developer's Network
Copyright © Yoto Yotov



Acquiring image from ProHosting Banner Exchange