convert integers to ascii
hello
does somebody know if there is a built-in function in c to convert an integer vaue into a "string"? i need to store for example 234 in this form: char *value; the result then shoud be: *(value+0)=2 *(value+1)=3 *(value+2)=4 any ideas? or do i have to write my own function to do this??? thanks raven |
You need your output string to be already allocated, then do something like:
int Number = 234; char Value[MAX_SIZE]; sprintf(Value, "%d", Number); |
The function itoa is also made specifically for converting integers to a character array.
|
Quote:
|
All times are GMT -5. The time now is 05:03 PM. |