#include <stdio.h>
int main() {
char str[50];
printf("Enter a string : ");
gets(str);
printf("You entered: %s", str);
return (0);
}
In my code, why isn't the gets()
function declared? It shows me a bunch of errors such as:
In function ‘int main()’:
error: ‘gets’ was not declared in this scope
gets(str);
^~~~
[Finished in 0.2s with exit code 1]
I want to know why this kind of problem occurs?