I have an object which has a 2d char array as a property.
I'd like to create an accessor method which is able to return a pointer to this 2d array.
I have declaired the 2d array like this:
#define PRESET_LEN 15
#define NO_PRESETS 8
char camPresets[NO_PRESETS][PRESET_LEN];
Being new to C++ I'm having a bit of bother trying to fiigure out the method declairation.
So far I have this in the header :
char** getPresetsForCamera(int cam);
and this in the cpp
char** DataManager::getPresetsForCamera(int cam)
{
if(currentCam != cam)
load(cam);
return camPresets;
}
But it does not compile. I obviousely havn't understood how to use pointers properly, at least for 2d arrays, I thought I could just write 'return &camPresets;' to return the address of the array but I'm wrong. Please could someone show me where I'm going wrong. Thanks, Rick.