hello,,
i need help on how to open files by using variable names..
here's my function:
void stringSearcher(string filename, string search) { ifstream file; file.open(filename); if(!file.is_open()) { cerr<<"File can't be open..."<<endl; exit(1); } string line; while(!file.eof()) { getline(file, line); if(line.find(search)==0) { displayTitle(line); exit(1); } } }
my problem is that there's always an error on the file.open line...
"no matching function to call...etc"
this is where i call the function in my main:
while (pent=readdir(pdir)) { if (checkXML(pent->d_name)) { list.push_back(pent->d_name); string title("<TITLE>"); [B]stringSearcher(pent->d_name, title);[/B] } }
sorry if you don't understand it,,
thx for helps... i need this asap btw,,