for(int i=0; i<v.size(); i++)
for(int j=0; j<v[i].size(); j++)
cout<<v[i][j]<<" ";
cout<<endl;
for( auto &row : arr) {
for(auto col : row)
cout << col << " ";
cout<<endl;
}
//this way you can print your array row by row
for (int i = 0; i < row; i++){
for (int j = 0; j < column; j++){
cout << array[i][j];
}
}
//this way you can print your array column by column
for (int i = 0; i < column; i++){
for (int j = 0; j < row; j++){
cout << array[i][j];
}
}
2-D Vectors
vector<vector<int>> vect;
for (int i = 0; i < vect.size(); i++)
{
for (int j = 0; j < vect[i].size(); j++)
{
cout << vect[i][j] << " ";
}
cout << endl;
}
for(int row=0; row<=3; row++){
for(int col=0; col<=2; col++){
Serial.print(buff[row][col]);
delay(200);
}
Serial.println();
}
Code Example |
---|
Cpp :: increment c++ |
Cpp :: ubuntu dotnet core install |
Cpp :: string to int c++ |
Cpp :: delete specific row from dynamic 2d array c++ |
Cpp :: casting c++ |
Cpp :: index string c++ |
Cpp :: sort 0 1 2 leetcode |
Cpp :: OpenGL C++ Version |
Cpp :: upcasting in c++ |
Cpp :: c++ vectors |
Cpp :: how to delete a file in cpp |
Cpp :: cstring to string |
Cpp :: c++ array rev pointer |
Cpp :: use uint in c++ |
Cpp :: continue statement in c++ program |
Cpp :: stack implementation using class in c++ |
Cpp :: cpp create lambda with recursion |
Cpp :: min heap priority queue c++ |
Cpp :: detect cycle in an undirected graph |
Cpp :: string vector to string c++ |
Cpp :: float to int c++ |
Cpp :: c define |
Cpp :: insertion sort cpp |
Cpp :: word equation numbers |
Cpp :: std::copy C ++ |
Cpp :: pointer cpp |
Cpp :: factorial of large number |
Cpp :: long pi in c++ |
Cpp :: c++ vector first element |
Cpp :: find pair with given sum in the array |