c_sparky, thank you! could you help me figure some things out?
so i deleted most of the things, so i could understand the code better :P but the main thingy is still working. How could i add all there files and folders which are 'FindData.cFileName' to a massive? i tried to add them to like char massive, but it aint working for me... and then i have to go through all of them to pick only the ones that have 'male', 'female' or both inside the name, so i used switch. so first of all can i use CHAR to add the names in the massive and later use them??
Code:
#include <cstdlib>
#include <windows.h>
#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;
int main()
{
HANDLE hFind;
WIN32_FIND_DATA FindData;
int ErrorCode;
char path[40], nr;
cout << "Enter a path"<<endl<< "egz: c:\\folder\\*.*" << endl;
cin>>path;
cout<< "Content inside:"<<endl<<endl;
hFind = FindFirstFile(path, &FindData);
if(hFind != INVALID_HANDLE_VALUE)
{
cout << FindData.cFileName << endl;
while (FindNextFile(hFind, &FindData))
{
cout << FindData.cFileName << endl;
}
ErrorCode = GetLastError();
if (ErrorCode == ERROR_NO_MORE_FILES)
{
cout << endl << "All files logged.\n" << endl;
}
system("PAUSE");
}
cout<< "1-female, 2-male, 3-both, +-off\n";
while ((nr=getchar())!='+')
{
switch (nr)
{
case '1':
break;
case '2':
break;
case '3':
break;
default:
break;
}
}
return 0;
}