malloc of a struct array

I am having problems with a large array of a data structure. I am trying to eliminate this error. I don't know how to use the malloc() function? Any help would be great.

Microsoft C++ exception: std::invalid_argument at memory location 0x0020F538.



struct SE70_ParameterListType
{
int SE70_ParNum;
string SE70_Items[64];
};

SE70_ParameterListType ParList[600];

SE70_ParameterListType *myPointer;
myPointer = malloc(600 * sizeof(SE70_ParameterListType)); // allocates on heap

Why do you use malloc()?
Am desperate and was trying anything I could to make mem available for the large array.
These should give you different errors (or not):
1
2
3
4
5
6
7
8
9
struct SE70_ParameterListType
{
  int SE70_ParNum;
  std::array<std::string, 64> SE70_Items;
};

std::array<SE70_ParameterListType, 600> ParList;

std::vector<SE70_ParameterListType> myPointer( 600 );  // on "heap" 

Topic archived. No new replies allowed.