I want to make a function that creates an new array and returns it
What is the best way to do it?
I could use:
int* createArray(){
int *a = new int[5];
return a;
}
but then I only have a pointer to first element of array and I don't know the size. So I can't iterate through it? Do I need to create a struct to contains pointer to first element and size?