How to convert integer into character array in C language?

Although windows have “itoa” function but I did not find it in Linux. That time, I did Google and found a beautiful function for conversion of integer value into character string. Sample code is given below,

#include <stdio.h>

void main()
{
  char fun[80];
  int value = 1943743;
  sprintf(fun, "%d", value);
}

Enjoy and say AHO!

One thought on “How to convert integer into character array in C language?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s