This is probably a very easy question, but for some reason I don’d understand what I’m doing wrong here.
Anyways, I got a function that takes in function(size_type m, size_type n) and I have to build an array which is pointed to by a private variable in the class called int *value. I am trying to create an integer array of mxn size but I am having difficulty changing the type of m and n.
I tried:
*value = int[(int)m*(int)n];
as well as using (unsigned int) can someone please help.
EDIT: size_type isn’t declared as any type in the specs
You may consider:
because you need to create a dynamic array. You will need to remember to
delete []this at the correct times.You will probably find it easier to work with a
std::vector, because the memory management is handled for you.