My Linux system won't allow me to use gets function as probably it is not safe, so I have to use fgets:
error: ‘gets’ was not declared in this scope
scanf("%d ", &d); gets(line);
^~~~
So using fgets is good for compatibility. However, fgets includes newline to the result,
so without this simple fix, the code will loop forever as 4 strcmps at line 49-55 won't match.
My Linux system won't allow me to use
gets
function as probably it is not safe, so I have to usefgets
:So using
fgets
is good for compatibility. However,fgets
includes newline to the result, so without this simple fix, the code will loop forever as 4 strcmps at line 49-55 won't match.