According to K&R, strcmp cab be used to compare two lines, lexicographically. (p.119)
They use another function, numcmp, to compare two lines numerically. However, aren't these two descriptions basically the same?
Isn't the Lexicographic order of ASCII characters the order in which they appear on the list, which is determined by their machine integer value? That would mean that numcmp and strcmp are basically identical.
Edit:
When they say the numeric value of a line, do they mean adding up the ASCII integer values of all of the characters in the line?
Edit:
I'm not sure why my question is getting thumbed down. Should I inherently know what the numeric value of a line means?
1 Answer 1
5 is numerically less than 10, but "10" is lexicographically less than "5".
'0円'?123has value of the number123