I have a program that reads the files in its directory, and then puts them in a .txt file:
The problem is, I don't want it to count itself or two other file names. I've already taken care of . and .. with the fileOutputCount.
strncat(DirSpec, "\\*", 3);
hFind = FindFirstFile(DirSpec, &FindFileData);
int fileOutputCount = 0;
ofstream a_file ( "oldnames.txt" );
if (a_file.is_open() )
while(FindNextFile(hFind, &FindFileData) != 0)
if (fileOutputCount > 1 )
Next problem, same program:
I'm also reading line from another file, and they have spaces. I needed to read filenames, seperated by a new line. Currently, I have this:
I figure it has something to do with the "%s", but unfortunately, that was taken from another program, and searching for "%s" doesn't show anything useful.
fscanf(fp_fileNames, "%s", newFileName);
Thanks in advance,