Initializing Multidimensional Arrays - C++ Data Type

C++ examples for Data Type:Array

Description

Initializing Multidimensional Arrays

Demo Code

#include <iostream>
#include <locale>

int main()// w ww.  jav a2 s  . c o  m
{

    double a[3][4] {
                           {2.5, 3.2,  3.7,  4.1},   // First row
                           {4.1, 3.9,  1.6,  3.5},   // Second row
                           {2.8, 2.3,  0.9,  1.1}    // Third row
                         };

    std::cout << a[0][0];
}

Result


Related Tutorials