sprintf

언어/c언어2017. 11. 30. 13:24

  #include <stdio.h>


       int printf(const char *format, ...);

       int fprintf(FILE *stream, const char *format, ...);

       int dprintf(int fd, const char *format, ...);

       int sprintf(char *str, const char *format, ...);

       int snprintf(char *str, size_t size, const char *format, ...);




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

  3 int main(void) {

  4     char s[100] = {0,};

  5 

  6     sprintf(s, "ls %s", "-al");

  7     system(s);

  8 

  9     return 0;

 10 }



'언어 > c언어' 카테고리의 다른 글

백준 2920  (0) 2017.12.03
백준 5622  (0) 2017.12.03
c언어 문제  (0) 2017.11.27
네이버 문제  (0) 2017.11.23
네이버 문제  (0) 2017.11.22