In the topic related to gets() why is that iam able to enter more than 2 characters even thought I changed the array size to 2 | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

In the topic related to gets() why is that iam able to enter more than 2 characters even thought I changed the array size to 2

C programming

1st Jul 2020, 10:04 AM
Alamelu Chandrashekar
2 ответов
+ 3
Please mention in the tags for which language are you talking about? You can edit your question by clicking on the upper right corner of your question.
1st Jul 2020, 10:08 AM
Arctic Fox
Arctic Fox - avatar
0
...and that is why you shouldn't use gets()...you might overwrite something in memory...use fgets().
1st Jul 2020, 10:45 AM
rodwynnejones
rodwynnejones - avatar