Convert an integer or a float to a string
Does there exist any other function which can be used to convert an integer or a float to a string?
Some implementations provide a nonstandard function called itoa(), which converts an integer to string.
char *itoa(int value, char *string, int radix);
DESCRIPTION - The itoa() function constructs a string representation of an integer.
value: Is the integer to be converted to string representation.
string: Points to the buffer that is to hold resulting string. The resulting string may be as long as seventeen bytes.
radix: Is the base of the number; must be in the range 2 - 36.
Another portable solution exists. One can use sprintf():
char s[SOME_CONST]; int i = 10; float f = 10.20; sprintf ( s, "%d %f\n", i, f );
2007-02-26, 8008👍, 0💬
If cookies are not enabled at browser end does form Authentication work? No, it does not work.
Can you tell me how to check whether a linked list is circular? Create two pointers, and set both to...
What is the result of using Option Explicit? When writing your C program, you can include files in t...
What is the sequence of UML diagrams in project? First let me say some fact about this question, you...
When does the compiler not implicitly generate the address of the first element of an array? Wheneve...