= end; i = std::wcstol(p, &end, 10)) { std::wcout << "'" << std::wstring(p, end-p) << "' -> "; p = end; if (errno == ERANGE){ std::wcout << "range error, got "; errno = 0; } std::wcout << i << '\n'; } } 可能的输出: Parsing L'10 ...