0
Second code is showing an error when I entered something as an input
4 Respuestas
+ 2
What code ?
+ 2
You will get only warnings not errors..
Use fgets() instead of gets();
Like ex:
fgets(a, 100,stdin);
gets() is not recommended when input is more length than its array size, it leads to unwanted results.. So hence warning....
+ 2
fgets(a,100,stdin);
Do not use gets and you can read about it on web to find the reason.
0
#include <stdio.h>
int main() {
char a[100];
gets(a);
printf("You entered: %s", a);
return 0;
}
This one