Ive had a look at this post: Find if string ends with another string in C++
I am trying to achieve a similar goal.
Basically i want to take a file list from a directory and filter out any files which do not end with a specified allowed extention for processing in my program.
In java this would be performed by creating a method and passing the extention accross as a string then using .endswith in the following statement. C++ does not appear to support this so how would i go about it?
for (int fileList = 0; fileList < files.length; fileList++)
{
//output only jpg files, file list is still full
if(files[fileList].toString().endsWith(extension))
{
images.add(files[fileList]);
}//end if
}//end for
Thanks in advance