Im trying to create dynamically an array of pointers to files. The user is requested to input an integer number to be used for size and I need to create an array of pointers with that size.
FILE** arrOfFiles = NULL;
printf("Enter the number of units\n");
scanf("%d", &numOfUnits);
arrOfFiles = (FILE**)malloc(sizeof(FILE*)*numOfUnits);
is that declaration good for what im trying to do? I just wan't to make sure. Thanks.