Assume following example code:
//open some file
char* data[10];
for ( int i=0; !feof(file) && i < 10; i++ )
{
fgets( data[i], 100, file );
}
//close file
AFAIK using a pointer array without allocating memory to individual pointers like this is unsafe and if works, it's because there happens not to be any vital information contained at that memory region.
But I have seen many people using it like this and I doubted myself.
Is this a proper use?