Initializing vectors

  • Vectors and Matrices are not initialized by default
  • You can initialize them when you define them
  • for example, intVector A(10, 0); // 10 integers, all initially zero charVector B(80, 'x'); // 80 characters, all initially 'x' floatMatrix C(5, 6, 3.1415); // 5x6 matrix, all initially 3.1415
    next...
    prev...
    begin lecture again...