how do i work this thing?
i got a access violation
edit: with the last number, that is...)
Printable View
how do i work this thing?
i got a access violation
edit: with the last number, that is...)
The first argument is the number being converted.Code:int main()
{
char Buffer[64];
int MyVar = 165;
cout << "Look, 165: " << itoa(MyVar, Buffer, 10) << endl;
cout << "Look, 165 in hexadecimal: " << itoa(MyVar, Buffer, 16) << endl;
cout << "Look, 165 in binary: " << itoa(MyVar, Buffer, 2) << endl;
return 0;
}
The second argument is an adress to a buffer (the string got to be stored somewhere).
The third argument is the radix, the base, of the converted number, ie 2 for binary, 8 for octal, 16 for decimal etc...
Or 10 for a normal decimal numberQuote:
The third argument is the radix, the base, of the converted number, ie 2 for binary, 8 for octal, 16 for decimal etc...
ya, forgot the most basic one... :rolleyes:Quote:
Originally posted by face_master
Or 10 for a normal decimal number
or 3 for ternal
or 4 for quaternal
or 5 for quinal
or 6 for senal
or 7 for septenal
or 9 for nonal
or 11 for undenal
or 12 for duodecimal
or 13 for tridecimal
or 14 for quattuordecimal
or 15 for quindecimal
or 17 for septendecimal
or 18 for octodecimal
or 19 for nonadecimal
or 20 for vigesimal
or 30 for trigesimal