home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / EXAMPLES / EX0325.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-27  |  444 b   |  15 lines

  1. // \EXAMPLES\ex0325.cpp
  2.  
  3. #include <iostream.h>
  4.  
  5. void main() {
  6.    const int size = 5;              // define array size constant
  7.    int int_array[size];             // define array
  8.    for (int i = 0; i < size; i++){  // step through array
  9.       int_array[i] = i;             //   initialize array element
  10.                                     //   print array element
  11.       cout << "int_array[" << i << "] is " << i << endl;
  12.    }
  13. }
  14.  
  15.