if (*argdata != '/' && *argdata != '-') argdata is wchar type,so you should do as if (*argdata != L'/' && *argdata != L'-')