What's the error in this code? I've got an error
error C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead
What it's mean? Another question - the declaration of the struct and the function prototype is legal?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main()
{
char *join(char *, char *);
printf("%s \n", join("duck", "soup"));
}
char *join(char *s1, char *s2)
{
struct {
char buf[256];
} string;
string.buf = "abcd";\\ new line. error l-value.
return strcat(strcpy(string.buf, s1), s2);
}
The new line - why there is an error? isn't string.buf
a char pointer? what's the problem with char *s="abcd"
?
Thanks!:)