Im trying to crate a two dimensional array of FILE pointer
when I did this:
FILE *pFile = OpenFile(fileName);
FILE **lossArr = (FILE**)malloc(sizeof(FILE*) * i * j);
lossArr [0] = pFile;
fputs ("some text\n",(lossArr[0]));
it worked fine,
but when I added *
to make it two dimensional array:
FILE *pFile = OpenFile(fileName);
FILE ***lossArr = (FILE**)malloc(sizeof(FILE*) * i * j);
lossArr[0][0] = pFile;
fputs ("some text\n",(lossArr[0][0]));
I got Access violation writing location 0xcdcdcdcd.
I saw declaration of two dimensional array with malloc, but I would like to know what is the way to create two dimensional array of FILE pointers? what is wrong with my code.
thanks in advanced!