So I'm trying to match a string against a wildcard to see whether they match. I'm using a snippet found here: http://www.planet-source-code.com/vb...=1680&lngWId=3
However, this doesn't seem to be working. My code implementation is as follows:
allFiles is a vector with a directory listing of that directory. files is a string containing the wildcard (so like t*.cpp).
for (int i = 0; i < allFiles.size(); i++)
char *buf1 = new char[allFiles[i].size() + 1];
char *buf2 = new char[files.size() + 1];
cout <<allFiles[i] <<" " <<wildcmp(buf1, buf2) <<endl;
if (wildcmp(buf1, buf2))
Please let me know what's going on. wildcmp always returns 0.