top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What do the functions atoi(), itoa() and gcvt() do

+6 votes
What do the functions atoi(), itoa() and gcvt() do
posted Dec 3, 2013 by Prachi Agarwal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

atoi()-is used for convert string to integer.
itoa()-is used for convert integer to string.
gcvt()-is used for convert double to string.

answer Dec 3, 2013 by Giri Prasad
0 votes

atoi() is a macro that converts integer to character.
itoa() It converts an integer to string
gcvt() It converts a floating point number to string

answer Dec 4, 2013 by Neeraj Pandey
Similar Questions
+3 votes

In K&R I found a piece of code which showed how atoi() works. It said like s[i] - '0' will give a numeric value of the character.

Can someone please explain it to me. I tried to search around but they only explain it with integers and not with characters. Say you are given s[i] = 'C'.

0 votes

int main(void)
  int *p
  int size = 10;


  while(i != size)
    *p++=1;       /*    METHOD 1       */


  while(i != size)
    i[p] = 1;         /*    METHOD 2    */

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.