These points are mostly designed-oriented:
I'd recommend having
len()return asize_twhile makingwithias the same type. This type is preferred for size functions (especially library ones) because it is unsigned (non-negatives), whereasintand is signed (non-negatives and negatives)also used in libraries.Although just another form,
lstrip()can be done this way:char* lstrip (char* string) { // skip and return right away if condition is not met if (string) { /* Trim off leading whitespace */ while (*string == ' ') { string++; } } return string; }Also, your plain
returnwon't work because the function is supposed to return achar*.