I should remember this but I am rusty. I'm passing a char* [] to a function which will hold data that I have extracted using strtok. I've tested the output and it is doing what it is suppose to, at least it is inside of the function. As soon as I try to access the data inside of main I just get garbage. How do I pass the char* [] by reference? I thought that arrays were always passed by reference, well to be more specific that the pointer was copied but the array itself was by reference. I was trying something like this:
int main () {
char* array [];
function (array);
}
void function (char* []){
// fgets and other setup
array [0] = strtok (data, delimiters);
// loop to max argument size or till out of arguments
array[i] = strtok(NULL, delimiters);
}
Like I said I can check the array inside of the function and it is all there but I lose it when I get to main.
Thanks for the help