// Heap allocated array in c++
//using std::vector
#include <vector>
std::vector<myarray> bestArray(100); //A vector is a dynamic array, which (by default) allocates elements from the heap
//or managing memory yourself
myarray* heapArray = new myarray[100];
delete [] heapArray; // when you're done
//How to use vector to put elements inside the array.
// C++11:
std::vector<myarray> bestArray{ 1, 2, 3 };
// C++03:
std::vector<myarray> bestArray;
bestArray.push_back(myarray(1));
bestArray.push_back(myarray(2));
bestArray.push_back(myarray(3));