The driver program and the header file are available for download on the web. (Notice that the names they have on the server are different from the names they're supposed to actually have; this was so I would know where they belonged on the server. Rename the header file as strfun.h (you should be fine with the driver program keeping its current name). Read the header file before coding the functions, as it describes the desired behavior. Notice that these functions are included in the namespace m330. I may change the driver program slightly before running your programs, but it will generally be the same.
// length finds the length of s int length(const char * s); // strpos returns the index of the first occurrence of b in s int strpos(const char * s, char b); // revstr returns the string s, reversed void revstr(char * s); // strrpos returns the position of the last occurrence of c in s int strrpos(const char * s, char c); // substr returns the substring from positions a through b void substr(char * s, int a, int b); // trim removes whitespace from the beginning and end of s void trim(char * s); // ucwords capitalizes the first character of each word in s void ucwords(char * s);You may use the assert and cctype libraries. You may not use any functionality of any string library.
A design document is required for this assignment; however, sample output is not. (I'll run your programs since part of the assignment is making them fit into my driver program properly.)