I want to read a string and check if it ends in a .txt
I thought about using strcmp to compare it against a correct string including the .txt but not sure if this would work or is the way it is generally done.
Essentially I want to use a loop:
if (string does not end in .txt)
use strcat to add .txt to end of string
else
nothing
Could anyone explain how to do this?