Visual Studio is yelling at me about using itoa() saying to use _itoa() instead?
It looks to me like they are the same function. What gives?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A C run time library implementation is not supposed to introduce names that aren’t in the standard unless they follow a certain naming convention (like starting with an underscore). The earlier versions of Microsoft’s compiler didn’t follow this rule particularly closely, but over time, Microsoft has been moving more toward making their implementation more standards compliant. So functions they used to supply that would intrude on the user’s namespace they have been implementing using names that are reserved for compiler implementations and have been deprecating the old names.
If
_CRT_NONSTDC_NO_WARNINGSis defined, the MS compiler won’t complain about theitoa()function being deprecated. But it will still complain about it being unsafe (you have to define_CRT_SECURE_NO_WARNINGSto quiet that warning). Or use the safer version of the function (_itoa_s()) that provides the function with the destination buffer sizeBoth
_itoa()anditoa()resolve to the exact same function in the library down to the same address – there is no difference except in the name.