Wrong Answer

user01 Reply 9 years 27 weeks ago
How to exit while statement that uses mgetline when EOF is found?
pichulia Reply 9 years 27 weeks ago
1. mgetline using "char array" but array[] is "int array". should change this. 2. %s can't print EOF . in your code, array[limit-2] = EOF, and array[limit-1] = 0; so printf("%s",array); try to print EOF.. but "EOF IS NOT A KIND OF CHARACTER". you must not print this number by using %c or %s. change this 3. mgetline don`t return anything. please add some state.
user01 Reply 9 years 27 weeks ago
Why do I need to print EOF?
pichulia Reply 9 years 27 weeks ago
you must not print EOF
user01 Reply 9 years 27 weeks ago
Do i print out the array character by character instead of the string?
user01 Reply 9 years 27 weeks ago
The program runs and the output is correct. I also believe that the program ends when EOF is reached. However, I am getting wrong answer.