Timeout core dump error using fgets | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Timeout core dump error using fgets

Please run my code with input: hello Im not really sure what the error means, my code was working fine until i switched the scanf() function for fgets() to be able to read in a full line of code with spaces, so the issue could be my ignorance on the fgets() function, however i implemented it per the tutorial here. Any help would be appreciated. https://www-geeksforgeeks-org.cdn.ampproject.org/v/s/www.geeksforgeeks.org/taking-string-input-space-c-3-different-methods/amp/?amp_js_v=a3&amp_gsa=1&usqp=mq331AQFKAGwASA%3D#aoh=15993125101457&csi=1&referrer=https%3A%2F%2Fwww.google.com&amp_tf=From%20%251%24s&ampshare=https%3A%2F%2Fwww.geeksforgeeks.org%2Ftaking-string-input-space-c-3-different-methods%2F https://code.sololearn.com/cgF8O5edf7k6/?ref=app

5th Sep 2020, 2:25 PM
Robert Atkins
Robert Atkins - avatar
3 Answers
+ 2
Line 88, it must be i<strlen(source) Correct condition... for(int i = 0; i<strlen(source); i++)
5th Sep 2020, 2:33 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 freaking wow, must of accidentally deleted the i. Thank you lol
5th Sep 2020, 2:48 PM
Robert Atkins
Robert Atkins - avatar
+ 1
Oh.. Robert Atkins My pleasure it helped.. You're welcome...
5th Sep 2020, 2:55 PM
Jayakrishna 🇮🇳