strcat.c 315 B

12345678910111213
  1. #include <string.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. int main(void) {
  5. char dest1[12] = "hello";
  6. printf("%s\n", strcat(dest1, " world")); // should be hello world
  7. char dest2[12] = "hello";
  8. printf("%s\n", strncat(dest2, " world foobar", 6)); // should be hello world
  9. return EXIT_SUCCESS;
  10. }