Declaring Multiple Variables


You can declare several variables of the same type in the same statement simply by separating them with commas:

int x = 10, y, z = 11;

This statement creates three integers called x, y, and z. The first integer is initialized to 10 and the third to 11, while the second is not initialized.




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