I've got a task in which I get a string and a path to a directory and I must open every .txt file from that directory and all subdirectories and print all the .txt in which I could find that string.
I managed to get the path to those .txt files in the directory, but I cannot go further to the subdirectories. Is there any command to do this? In Python I used:
for path, dirs, files in os.walk(dirPath):
for f in files:
if f.endswith('.txt'):
But i cannot find a command like that in c++.
Thanks