Note 7.5.1.
On some machines, comparing an
int
to the output from length
will generate a type error. This is because the length function returns an unsigned integer type. To keep the variable type consistent, you should use size_t
rather than int
for the type of the counter you use to keep track of the current index in the string.