B
Ben Bacarisse
Are you serious about this? Before you answer that first question, I would
just want you to know, those course books are from OUHK (Open University
of Hong Kong, that's where I currently study about this) taken from the
course code MT258.
I would not push this too far if I were you. I have had a look at some
of the TMA solutions and there are worse errors in there the void main()
and fflush(stdin)! One solution has some very odd logic (I can't say
"wrong" because the spec. is not given in the solution paper so it is
possible the strange behaviour is allowed). In one place in the
supporting material by the same author gets and scanf("%[\n]", ...) are
given as examples. In another, the example can overwrite an array.
Others use sentinel values which I don't think of a good practise.
Even good book can have errors, but these just look like bad teaching
examples to me.