Name:
Anonymous
2007-01-29 6:01
How do I declare a function of array type in C++? I are forget.
Name:
Anonymous
2007-01-29 6:25
// Returns allocated array
int *MyArrayFunction( int size )
{
assert(number>0);
int *array = new int[size ];
return array;
}
You cannot return an array type in C++, it doesnt allow you because it has now way of knowing the size of the array in question in the return space.