-
casting
hi there good people,
i would like to ask a simple question :>)
spouze you have this:
int number = 1;
TCHAR something[10];
and i would like to know how do i cast:
something = number;
so...
cout<<something;
would produce:
1
it's seems simple enough, i just don't know the language that well,
thankx in advance for your kind time.
1976
-
the easiest way is sprintf();
sprintf(something,"%d",number);
now something contains (the now character value) 1
-
you can also do
itoa(number,string,10);
the 10 means the base you want to convert it to, for example a value of 16 would give an hexagesimal value into the string, this value can go up to 36
Oskilian