1

When I compiled the code below, the compiler showed an undefined reference to itoa() function. But, when I searched; I found that itoa() is standard. Why is it so?

 #include <stdio.h>
 #include<stdlib.h>
 int main()
{

  int i;
  char buffer [33];
  printf ("Enter a number: ");
  scanf ("%d",&i);
  itoa (i,buffer,10);
  printf ("decimal: %s\n",buffer);
  return 0;

}

1 Answers1

0

Please check link below.

http://www.cplusplus.com/reference/cstdlib/itoa/

itoa is not standard function but some compiler support it.

On above link few alternative for it is provided.

Manthan Tilva
  • 3,135
  • 2
  • 17
  • 41
  • I don't think a C++ link is useful for a C based question (Even if it does not matter for this specific question, someone might be tempted to use the link as a permanent source of information. Sooner or later, that might end up bad) – tofro Sep 14 '16 at 13:12
  • @tofro If you check carefully left side bar of page, its reference for `C library` – Manthan Tilva Sep 14 '16 at 13:16