fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main ()
  5. {
  6. char str1[]= "To be or not to be";
  7. char str2[9];
  8. strncpy (str2,str1,9);
  9. str2[8]='\0';
  10. puts (str2);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 4180KB
stdin
Standard input is empty
stdout
To be or