fork download
  1. #include <string.h>
  2. #include <stdio.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. char str[20]={1,1,1,1,1,'z','z','z','z','z'};
  7.  
  8. strncpy(str, "abcdefg", 15);
  9.  
  10. printf("%s\n", str);
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
abcdefg