how to check if a specific file extension exist in a text file using c++?

Hello i want to check if .txt extension is in the text file named directorycontents.txt which has all my contents of my directory listed in text of which is loads of image.png,title.txt,fail.bmp,etc


how would i do that in c++ looking around on google havn't found an easy and simple solution to my problem so i was hoping someone with more experience would be able to point me in the right direction or show me what to do.


Look up the find function in the string class.
how would i get a text file into a string object automatically? if thats what your telling me
Last edited on
That is what I'm suggesting. Read this link: http://www.cplusplus.com/reference/iostream/ifstream/open/ and that should help you get started.
Topic archived. No new replies allowed.