fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. #define STR "ST%d"
  6. #define MAX_MSG 80
  7.  
  8. char name[MAX_MSG+1] ;
  9.  
  10.  
  11. int main(int argc, char **argv) {
  12. printf("Before: %s\n",name); //--debug
  13. sprintf(name,STR,1); //format by 1
  14. printf("After: %s\n",name);
  15. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
Before: 
After: ST1