Im getting this error over my function prototype in the code below:
Code:
#include <stdio.h>
void strcat(char s[], char t[]); /* error here */
int main(void)
{
char s[4] = {"abcd"};
char t[9] = {"abcdefgh"};
(strcat(s, t));
return 0;
}
void strcat(char s[], char t[]){
char match;
int i, j, x, q;
i = j = x = q = 0;
while(s[i] != '\0')
i++;
while(s[j] != '\0')
j++;
while(q <= i){
for(x = 0; x <= j; x++)
if(s[q] == t[x]){
match = 1;
}
else{
match = 0;
if(match == 1){
++q;
}
else{
t[j++] = s[q++];
}
}
}
int v = 0;
while(t[v] != '\0'){
putchar(t[v]);
v++;
}
}
Any ideas as to where im going wrong?