char[INT16_MAX] *strptr = (char[] *) malloc( sizeof(char[] *) );and
char st[INT16_MAX] *strptr ...;Neither of them works. What is the data type for a pointer to an array? I can't use char **, because the array has to be a fixed width. Otherwise the compiler won't let me read a line from a file into it and I get a segfault. Please don't tell me why the code I gave is wrong. I know perfectly well that it doesn't make sense; I just wanted to provide some examples to illustrate. You can ignore the malloc part. It really isn't important. All I want to know is how to make a pointer to a fixed width array so that I can deallocate the array later and not clog up memory.
Also, please no "You're not supposed to use INT16_MAX" or any of that crap that has nothing to do with the problem.


Sign In
Create Account


Back to top










