how do i work this thing?
i got a access violation
edit: with the last number, that is...)
how do i work this thing?
i got a access violation
edit: with the last number, that is...)
Last edited by Yoshi; 12-13-2002 at 02:47 PM.
Yoshi
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...
Last edited by Magos; 12-13-2002 at 02:51 PM.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Or 10 for a normal decimal numberThe 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...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
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.