Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to convert the integer (input from console let int i=123 ;)to string (means when I write ("printf ( "%s", str); ") The output should come "123". How do I do it ?Will anybody give some hints?
Posted

Check This One : -

C#
int main(void)
{
  int num=86;
  char buf[50];

  snprintf(buf, 50, "%d", num);
  return 0;
}
 
Share this answer
 
use the method
C++
itoa()
available in
C++
stdlib.h
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900