I have the following code
My question is this: if it enters the string comparison it will only compare the remainder of the directory - as opposed to starting again, and again and again until it no longer enters the if (strcmp) function. How should I go about this...I'm told I shouldn't use GOTO!!!Code:d = opendir(sf_homedir) int z = 1; if (d) { while ((dir = readdir(d))) { if ( strcmp (dir->d_name,x) == 0) { sprintf(x,"%s.%i",x,z); z++; } } }