I wish to create some code that checks if a string has the characters ".var" on the end of it or not.
The idea is that the user enters the path and filename to locate a .var file. This is then stored in a string. If they enter another file type other than a .var, I would like to be able to detect this.
I have attempted to use some string functions like strcspn but have not been able to come up with a viable solution, mainly because the string functions are not able to search strings with \ signs (vital part of a file path) in them without the compiler coming up with errors.
Can anybody help?!