strcat.c 302 B

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