fork download
  1. #include <stdio.h>
  2.  
  3. void create_path (const char *prefix, int id, const char *surfix, char *general_path) {
  4. sprintf(general_path, "%s%d%s", prefix, id, surfix);
  5. }
  6.  
  7. int main(void) {
  8. char path[100];
  9. create_path("/home/satirev/C++_docs/doc", 4, ".pdf", path);
  10. printf("%s", path);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
/home/satirev/C++_docs/doc4.pdf