Chapter 3 Quick Reference


To

Do this

Declare a variable.

Specify the type followed by spaces and then the variable name followed by a semicolon. For example:

 int number1; long longNumber1;

Assign values to a variable.

Use the assign operator =.

Group homogenous data together.

Use an array.

Prevent data from being changed.

Make the variable a constant. For example: const int x = 10;

Restrict the values a variable can accept to a small set.

Declare an enumerated constant, and declare the variable to be of that type.

Add member variables to a class.

Use the Add Member Variable Class Wizard.

Access a String class.

Use the .NET String class.

Find the size of an object or a type.

Use the sizeof() operator.

Convert one data type to another.

Use the static_cast<type> operator.

Override default operator precedence, or make the code more readable.

Use parentheses to group operators.




Microsoft Visual C++  .NET(c) Step by Step
Microsoft Visual C++ .NET(c) Step by Step
ISBN: 735615675
EAN: N/A
Year: 2003
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net