
Implement gm_strtol, your own strtol, which converts the start of a string into a signed long for a chosen base, then writes back the address of the first character it could not convert.
long v = gm_strtol("1A rest", &end, 16); /* v, end-str */26 off=2long v = gm_strtol("0x1A rest", &end, 0); /* v, end-str */26 off=4long v = gm_strtol(" -17abc", &end, 10); /* v, end-str */-17 off=5long v = gm_strtol("zzz", &end, 10); /* v, end-str */0 off=0strtol.c<stddef.h>defines NULLStandard C library
Implements the contract of a function from the standard C library.

Run the tests to grade your code
Implement gm_strtol, your own strtol, which converts the start of a string into a signed long for a chosen base, then writes back the address of the first character it could not convert.
long v = gm_strtol("1A rest", &end, 16); /* v, end-str */26 off=2long v = gm_strtol("0x1A rest", &end, 0); /* v, end-str */26 off=4long v = gm_strtol(" -17abc", &end, 10); /* v, end-str */-17 off=5long v = gm_strtol("zzz", &end, 10); /* v, end-str */0 off=0strtol.c<stddef.h>defines NULLStandard C library
Implements the contract of a function from the standard C library.

Run the tests to grade your code
Memory will appear here