Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //// ------------- найденная функция -----------------
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h> /* To completely get rid of this,
- implement your our strcpy as well */
- static void my_strcat (char* dest, char* src)
- {
- while (*dest) ++dest;
- while (*src) *(dest++) = *(src++);
- *dest = 0;
- }
- int main()
- {
- char* a1 = malloc(100);
- char* b1 = malloc(100);
- strcpy (a1, "Vivek");
- strcpy (b1, " Ratnavel");
- my_strcat (a1, b1);
- printf ("%s\n", a1); /* => Vivek Ratnavel */
- free (a1);
- free (b1);
- return 0;
- }
- // источник: https://coderoad.ru/4438541/%D0%9A%D0%BE%D0%BD%D0%BA%D0%B0%D1%82%D0%B5%D0%BD%D0%B0%D1%86%D0%B8%D1%8F-%D1%81%D1%82%D1%80%D0%BE%D0%BA-%D0%B1%D0%B5%D0%B7-strcat-%D0%B2-C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement