I have two questions:
1) How can I make an array which points to objects of integers?
int* myName[5]; // is this correct?
2) If I want to return a pointer to an array, which points to objects (like (1)) how can I do this in a method? ie) I want to impliment the method:
int **getStuff() { // what goes here? return *(myName); // im pretty sure this is not correct }
Thanks for the help!
Technically, you write this function:
That returns a pointer to that array. However, you don’t want to do that. You wanted to return a pointer to the first element of the array:
That way, you can now access items as you want like
getStuff()[0] = &someInteger;