For the most part, functions that begin with a leading underscore are implementation additions; they are not part of the C Standard Library. (There are exceptions, e.g. _Exit
is part of the C Standard Library, though it is not yet implemented in the Visual C++ implementation.) Identifiers that begin with a leading underscore are reserved in the global namespace, so they are used for nonstandard extensions to avoid conflict with user-defined names.
As for why there is no wtoi
in the C Standard Library: By the time wide character functions were added to the C Standard Library, it was understood that the atoi
interface is flawed because there is no way to detect whether the conversion succeeded or failed.
Do not use atoi
or _wtoi
. Instead, use the preferable strtol
and wcstol
functions, both of which are part of the C Standard Library. (There are other similarly-named conversion functions for other types, e.g. strtof
and wcstof
to convert to float
and strtoull
and wcstoull
to convert to unsigned long long
.)
wtoi()
nor_wtoi()
is standardized except, de facto, by Microsoft. – Siouxie