Why I am getting characters more than the declared array in the code below when I input more than 10 characters? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why I am getting characters more than the declared array in the code below when I input more than 10 characters?

#include <stdio.h> int main() { char a[10]; gets(a); printf("You entered: "); puts(a); return 0; }

21st Sep 2019, 4:30 PM
Darshnik Deep
Darshnik Deep - avatar
1 Answer