I am reading the values from a file that I will keep in memory when I read them. I read here that the correct way to handle a memory location in C ++ is to always use new / delete, but if I:
DataType* foo = new DataType[sizeof(DataType) * numDataTypes];
This will then call the default constructor for each instance created, and I don't want this. I was going to do this:
DataType* foo;
char* tempBuffer=new char[sizeof(DataType) * numDataTypes];
foo=(DataType*) tempBuffer;
But I thought that it would be something incomprehensible to some type - unpreparedness. So what should I do?
And now, examining this question, I saw that some people say that arrays are bad and vectors are good. I tried to use arrays more because I thought I was a bad boy, filling my programs (what I thought) with slower vectors. What should i use?