Ignoring Lines and Continuing through Spaces,
Hey,
I have a program that reads the files in its directory, and then puts them in a .txt file:
Code:
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)
{
++fileOutputCount;
if (fileOutputCount > 1 )
{
a_file<<FindFileData.cFileName<<"\n";
}
}
}
FindClose(hFind);
a_file.close();
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.
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:
Code:
fscanf(fp_fileNames, "%s", newFileName);
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.
Thanks in advance,
Blurr