fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. int X = 2, Y = 2;
  7. std::vector< std::vector< unsigned char > > index(X, std::vector<unsigned char>(Y));
  8. index[0][0] = 10;
  9. index[0][1] = 20;
  10. index[1][0] = 30;
  11. index[1][1] = 40;
  12. for(int i = 0; i < X; ++i) for (int j = 0; j < Y; ++j) cout << int(index[i][j]) << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
10
20
30
40