D
D. Susman
Hi,
What might the best way be to return a member variable array? (Except
using std::vector )
class A
{
public:
// one possible way; but size info is lost
const int* const getArrAsPtr()
{
return arr;
}
// Copy arr content into clientSuppliedBuffer.
// What if client supplies int clientSuppliedBuffer[0] ?
void getArr( int clientSuppliedBuffer[4] )
{
}
private:
int arr[5];
}
What might the best way be to return a member variable array? (Except
using std::vector )
class A
{
public:
// one possible way; but size info is lost
const int* const getArrAsPtr()
{
return arr;
}
// Copy arr content into clientSuppliedBuffer.
// What if client supplies int clientSuppliedBuffer[0] ?
void getArr( int clientSuppliedBuffer[4] )
{
}
private:
int arr[5];
}