R
Rob Schieber
Hey guys,
If I have a pointer to a *char, how do I allocate and free memory for it?
for example, if I had:
char* pstring = "Hello\0";
char** strings = &pstring;
strings[0] = pstring;
1. Is this a valid way to set up a list of strings?
and
2. How do I malloc/free the strings variable? Or is it even necessary
since I'm initializing the pointer array to the address of the first string?
Thanks in Advance
If I have a pointer to a *char, how do I allocate and free memory for it?
for example, if I had:
char* pstring = "Hello\0";
char** strings = &pstring;
strings[0] = pstring;
1. Is this a valid way to set up a list of strings?
and
2. How do I malloc/free the strings variable? Or is it even necessary
since I'm initializing the pointer array to the address of the first string?
Thanks in Advance