c++ multidimensional vector
C++
#include <vector>
vector<vector<int> > OuterVector;
vector<int> InnerVector_1;
InnerVector_1.push_back(10);
InnerVector_1.push_back(11);
InnerVector_1.push_back(12);
InnerVector_1.push_back(13);
InnerVector_1.push_back(14);
InnerVector_1.push_back(15);
OuterVector.push_back(InnerVector_1);
vector<int> InnerVector_2;
InnerVector_2.push_back(40);
InnerVector_2.push_back(41);
InnerVector_2.push_back(42);
InnerVector_2.push_back(43);
InnerVector_2.push_back(44);
InnerVector_2.push_back(45);
OuterVector.push_back(InnerVector_2);
for (unsigned int i = 0; i < OuterVector.size(); i++)
{
cout << "\n/------------------------(i=" << i << ")----------------------------/\n";
for (unsigned int j = 0; j < InnerVector_1.size(); j++)
{
cout << "OuterVector[i][j] = OuterVector[" << i << "][" << j << "] = " << (OuterVector.at(i)).at(j) << endl;
}
}
Also in C++:
- Title
- how to use wasd c++
- Category
- C++
- Title
- translate
- Category
- C++
- Title
- map vs unordered_map in C++
- Category
- C++
- Title
- c++ ros subscriber
- Category
- C++
- Title
- C++ remove element from set
- Category
- C++
- Title
- c++ code to print hello world
- Category
- C++
- Title
- how to run c++ file mingw cmd
- Category
- C++
- Title
- c++ find object in vector by attribute
- Category
- C++
- Title
- std::iomanip c++
- Category
- C++
- Title
- how to iterate over unordered_map c++
- Category
- C++
- Title
- nearest integer rounding in c++
- Category
- C++
- Title
- how use global variables instead of local in c++
- Category
- C++
- Title
- c++ show time elapsed
- Category
- C++
- Title
- find height of a tree
- Category
- C++
- Title
- inheritance protected in c++
- Category
- C++
- Title
- primeros numeors primos menores que
- Category
- C++
- Title
- single line if c++
- Category
- C++
- Title
- declaring 2d vector in c++
- Category
- C++
- Title
- c++ find prime numbers
- Category
- C++
- Title
- create new file c++
- Category
- C++
- Title
- C++ int to char*
- Category
- C++
- Title
- c++ random numbers
- Category
- C++
- Title
- c++ multiple inheritance diamond problem
- Category
- C++
- Title
- program to know if a number is prime
- Category
- C++
- Title
- vector concat c++
- Category
- C++
- Title
- c++ sql
- Category
- C++
- Title
- registering a new QML type
- Category
- C++
- Title
- c++ how to return an empty vector
- Category
- C++
- Title
- for loop
- Category
- C++
- Title
- error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(s[i] != "b"){
- Category
- C++
- Title
- how do for loops on c++
- Category
- C++
- Title
- select elements from array C++
- Category
- C++
- Title
- C++ If
- Category
- C++
- Title
- minimum swaps to sort an array
- Category
- C++
- Title
- how to type cast quotient of two integers to double with c++
- Category
- C++
- Title
- Runtime Error: Runtime ErrorAbort signal from abort(3) (SIGABRT)
- Category
- C++
- Title
- leveling system c++
- Category
- C++
- Title
- c++ while true loop
- Category
- C++
- Title
- zeros of array c++
- Category
- C++
- Title
- user input c++
- Category
- C++
- Title
- c++ convert int to cstring
- Category
- C++
- Title
- how to delete a node c++
- Category
- C++
- Title
- self in c++
- Category
- C++
- Title
- declare vectors c++
- Category
- C++
- Title
- compare function in sort c++ stl
- Category
- C++
- Title
- c++ movment
- Category
- C++
- Title
- cout value c++
- Category
- C++
- Title
- insert function in c++ vector
- Category
- C++
- Title
- to_string c++
- Category
- C++
- Title
- what are the different ways to traverse a binary tree
- Category
- C++
- Title
- how to know the correct class of objects cpp
- Category
- C++
- Title
- cout console
- Category
- C++
- Title
- how to iterate trough a vector in c++
- Category
- C++
- Title
- length of string c++
- Category
- C++
- Title
- lopping over an array c++
- Category
- C++
- Title
- range of long long in c++
- Category
- C++
- Title
- get elements of 2d array c++
- Category
- C++
- Title
- printf c++
- Category
- C++
- Title
- insert at position in vector c++
- Category
- C++
- Title
- how to find the size of a character array in c++
- Category
- C++
- Title
- what is difffrence between s.length() and s.size()
- Category
- C++
- Title
- how to convert int to string c++
- Category
- C++
- Title
- c++ remove item from list
- Category
- C++
- Title
- matrix transpose tiling
- Category
- C++
- Title
- reverse in vector c++
- Category
- C++
- Title
- c++ triple
- Category
- C++
- Title
- two sum problem in c++
- Category
- C++
- Title
- runtime array size c++
- Category
- C++
- Title
- sum of integer in array c++
- Category
- C++
- Title
- error: invalid use of template-name without an argument list
- Category
- C++
- Title
- how to delete an element in vector pair in cpp
- Category
- C++
- Title
- list conda environments
- Category
- C++
- Title
- add a timer c++
- Category
- C++
- Title
- how to take input in C++ in coding
- Category
- C++
- Title
- opencv compile c++
- Category
- C++
- Title
- c++ compiler for sublime text
- Category
- C++
- Title
- passing reference in c++
- Category
- C++
- Title
- insertion sort in c++ program
- Category
- C++
- Title
- how to append two vectors in c++
- Category
- C++
- Title
- body parser
- Category
- C++
- Title
- can you use a return to print a string when referencing an integer c++
- Category
- C++
- Title
- c++ create object
- Category
- C++
- Title
- c++ initialization list
- Category
- C++
- Title
- initialise 2d vector in c++
- Category
- C++
- Title
- ios_base::sync_with_stdio(false);cin.tie(NULL);
- Category
- C++
- Title
- write to file in C++
- Category
- C++
- Title
- how to cout in c++
- Category
- C++
- Title
- iostream library in cpp
- Category
- C++
- Title
- maximum possible number atmost k swaps
- Category
- C++
- Title
- c++ convert int to double
- Category
- C++
- Title
- popualte an array c++
- Category
- C++
- Title
- console colors in C++
- Category
- C++
- Title
- statement that causes a function to end in c++
- Category
- C++
- Title
- merge sort in c++
- Category
- C++
- Title
- swapo algorit
- Category
- C++
- Title
- best fit algorithm
- Category
- C++
- Title
- vector stl c++
- Category
- C++
- Title
- peak in c++
- Category
- C++
- Title
- nth_element c++
- Category
- C++
- Title
- c++ method name
- Category
- C++