wchar_t pointer manipulation - How to check whether it is ended with L".xls"
I am using C. I have a wchar_t pointer whi开发者_JAVA技巧ch pointing a a file path.
I was wondering, how I can check, whether it is ended with L".xls"?
Any function call I can use?
- Check that the string is at least 4 long
- See if the last 4
wchar_t
are ".xls"
Thus, this should be it:
if(wcslen(str) >= 4 && wcscmp(str + wcslen(str) - 4, L".xls") == 0)
Try wcsstr()
.
精彩评论