I got a problem. I wanted to see the difference between the gets and scanf(). However, my terminal shows up as::
warning: this program uses gets(), which is unsafe. Abort trap: 6
Is there some rule where the gets() and scanfs() can't get together in one code??
#include <stdio.h>
int main(void){
char passage[10];
printf("Enter in a passage same one twice:: \n");
scanf("%s", passage);
gets(passage);
printf("Using scanf:: %s", passage);
printf("Using Gets:: %s", passage);
}
P.S. People say that I am currently writing on the memory that I don't own, but I don't get the problem in this code. Thanks!!!