On a Windows machine,
we use,
"itoa(str,num,radix)", for converting an integer "num" to a string "str".
"atoi(str)", for converting a string "str" to integer.
But on a linux machine, these functions donot work when we use "gcc" for compilation. The equivalent functions are,
itoa --> sprintf(str,"%d",num);
Here, the second argument should be the format specifier of the number to be converted.
atoi --> sscanf(str,"%d",$num);
Here the second argument is the format specifier of the number to be converted into and
the third argument should be the address of the number variable.
Friday, August 7, 2009
Subscribe to:
Post Comments (Atom)
I guess this is a forum of a techie rather than a blog........
ReplyDelete