In the below code, line[]
array contains names of all image files contained in a folder. We are just reading the names dynamically and sending the file names one by one to a function function_foo
as given in the code. When there are 8 images the code is executing as expected. But as soon as we increase the number of image files in the folder to any number above 8, the process gets terminated and returns -1. Please suggest.
FILE **fp;
struct Structure_Name data[100];
fp = malloc( sizeof(FILE *) * 10000);
for(i=0;i<total; i++)
{
sprintf(fName,"/home/souvik/Images/%s",line[i]);
printf("%s\n",fName);
fp[i] = fopen(fName, "rb");
data[i]=function_foo(fp[i],(data[i]));
}