realloc and pointer conversion from sub to main function

This is a discussion on realloc and pointer conversion from sub to main function within the C Programming forums, part of the General Programming Boards category; Hello.
I'm having a difficult time figuring out how to set the plines[n] pointer. It looks like the realloc is ...

realloc and pointer conversion from sub to main function

Hello.
I'm having a difficult time figuring out how to set the plines[n] pointer. It looks like the realloc is working in the sub program, but I'm not having luck with printing it out in the main program.

On compile, I get, "Suspicious pointer conversion in function readfile". Basically, this means the pointer is not "set" on strdup(). Can somebody please take a look at this and help me with this pointer problem?
Thanks!

But I would do this, to trim the number of *** you have to deal with at any one time

This is how I would structure your readfile function

Code:

int readfile ( char ***plines ){
int num_lines = 0;
char **read_lines = NULL;
// here, you just deal with read_lines, which is just a char**
// and you don't have to bother with an extra level of indirection
// at the end, just copy the whole shooting match back to the
// outside world with a simple assignment, like so
*plines = readlines;
return num_lines;
}