Skip to the task
Layout
Back to classic view

You are looking at lesson 9. Your place is still lesson 4, task 1: Style.

CHECKTask 16 of 20 · step 7: Drills: check yourself

strtol and garbage at the end

What does strtol return, and where does end point?

char *end;
long x = strtol("  15kg", &end, 10);
Stuck?

x = 15, end points to "kg". read_int wouldn't accept such a line.