mercredi 24 novembre 2021

Declare multidimensional Arrays C++ (compared to python)

coming from python I have a hard time understanding the data structure types and their declaration in c++.

To declare and populate a multidimensional array in python you just do as an example:

arr = [[],[]]

for i in range(2):
      arr[i].append(1)

What would be the equivalent in C++? Do I have to use vectors or arrays?

Cheers

Aucun commentaire:

Enregistrer un commentaire