Search
 
SCRIPT & CODE EXAMPLE
 

CPP

2d stl array

/*
std::array is 1-dimensional, there is no such thing as a 2-dimensional std::array.
You would simply have to use an inner std::array as the element type of an outer 
std::array, eg:
*/
#include <iostream>
#include <array>

int main(){
  std::array<std::array<int,5>,4> myarray;
  for (int i=0; i<5; i++){
    for (int j=0; j<10; j++){
      myarray[i].at(j) = j+1;    
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: sort 3 numbers using swap cpp 
Cpp :: unity decompile il2cpp 
Cpp :: run c++ files on chrome book 
Cpp :: inverse elment of array c++ 
Cpp :: flutter websocket auto reconnect 
Cpp :: Code Example of Switch Statement in C++/Java 
Cpp :: skip headers while reading text 
Cpp :: is there interfaces in c++ like 
Cpp :: how to get the last digit of a number 
Cpp :: Processing a string- CodeChef Solution in CPP 
Cpp :: 1162261467 
Cpp :: c++ server service ros 
Cpp :: round function in c++ 
Cpp :: sieve of eratosthenes c++ 
Cpp :: c++ install 
Cpp :: type casting in cpp 
Cpp :: c++ variables 
Cpp :: while loop c++ 
Cpp :: c++ return statement 
Cpp :: char * to string c++ 
Cpp :: how to shorten code using using c++ in class with typename 
C :: wireshark tls client hello filter 
C :: golang loop through array 
C :: check if string starts with c 
C :: data types in c 
C :: thread in c 
C :: C how to find substring in string 
C :: string if statements c 
C :: c binary search 
C :: install tweaks ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =