I want the textfiles array emptied after each function call so initialized it inside the function but im now getting a segmentation fault. Ive looked at other questions regarding this problem but couldnt find what i was looking for.
void orphantags(char tags[SIZE1][SIZE2],char files [SIZE1][SIZE2],char orph[SIZE1][SIZE2])
{
char textfiles[100][1000];
int i,j,k=0;
for(i=0;i<SIZE1;i++)
{
if(strncmp(getFileExtension(files[i]),"txt",3)==0)
{
strcpy(textfiles[k],files[i]);
k++;
}
}
k=0;
for(i=0;i<SIZE1;i++)
{
for(j=0;j<SIZE1;j++)
{
if(strcmp(tags[i],textfiles[j])!=0)
{
strcpy(orph[k],tags[i]);
k++;
}
}
}
}