Упражнение 5.3. Используя указатели, напишите функцию strcat, которую мы рассматривали в главе 2
(функция strcat(s, t) копирует строку t в конец строки s)
Error: Multiple definition of strcat.
Error: First defined here.
Error: ld returned 1 exit status.
PS. И есть какой-то мануал по ошибкам компилции?
(функция strcat(s, t) копирует строку t в конец строки s)
Error: Multiple definition of strcat.
Error: First defined here.
Error: ld returned 1 exit status.
PS. И есть какой-то мануал по ошибкам компилции?
:
#include <stdio.h>
#include <stdlib.h>
#include "strcat.c"
void strcat(char *s, char *t);
int main()
{
char *s = "who is ";
char *t = "here?";
strcat(s, t);
printf("Concat?: %s\n", s);
return 0;
}
:
void strcat(char *s, char *t)
{
while (*s++)
;
while (*s++ = *t++)
;
}