Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to put an int in a string c

#include <stdio.h>
#include <stdlib.h>

  int main()
  {
        char stringg[35];
        int intt = 907;
		
    	//in C sprintf() is Function to Convert an Integer to a String.
        sprintf(stringg,"%d",intt);

        printf("
Your string contains the number: %s
",stringg);

        return 0;
  }
Source by stackhttps #
 
PREVIOUS NEXT
Tagged: #put #int #string
ADD COMMENT
Topic
Name
6+6 =