Hi i am new to the topic about strings. Can i know what is the differences between fgets or gets? i cant seem to get the same output.
andCode:#include <stdio.h>
#include <string.h>
int main(void)
{
char s1[80], s2[80];
fgets(s1, 80, stdin);
fgets(s2, 80, stdin);
strcat(s1, s2);
printf(s1);
return 0;
}
Thanks!Code:#include <stdio.h>
#include <string.h>
int main(void)
{
char s1[80], s2[80];
gets(s1);
gets(s2);
strcat(s1, s2);
printf(s1);
return 0;
}