Storing an array pointer in an array!

PaulS:

The code does not work.

Of course not. You are passing a pointer to an array of Strings to testpassarray. Then, in that function, you are creating, on the stack, an array of ints. Then, you are trying to set the first element beyond the end of the array to the value that is the address of the array of Strings.

Once the function ends, the array of ints goes away. The invalid assignment is lost.

You need to properly allocate space for the array, statically as a global array, or dynamically, using malloc() or new. The array MUST be of the right type to hold the pointers. You must assign the pointer to a valid element in the array.

There are just too many things you are doing wrong in that code.

Thanks, I never expected the code to work but just that it could be followed.

The array "stored" needs to be an array of pointers to the arrays in the main program but I don't know what type the pointer is. This array is global (as are the String arrays) so once the address of the array is stored it should stay where it is till I clear everything later.

In the other function "reprint" I need to get this pointer address back from the global array and then access the array based on that pointer.

The String arrays will not change between their pointers being placed into the global array and being used. Certain events will completely clear all the arrays and we start again.