(2)从后向前找'\'字符
TCHAR *p = fname + _tcslen(fname) - 1;
while(*p != _T('\\')) --p;
*p = 0;
此步可改为:
TCHAR *p = _tcsrchr(fname, _T('\\'));
*p = 0;
或直接:
*_tcsrchr(fname, _T('\\')) = 0;
TCHAR *p = fname + _tcslen(fname) - 1;
while(*p != _T('\\')) --p;
*p = 0;
此步可改为:
TCHAR *p = _tcsrchr(fname, _T('\\'));
*p = 0;
或直接:
*_tcsrchr(fname, _T('\\')) = 0;