// string-stuff.c includes "string-stuff.h" to make sure that the function // definitions match the declarations in string-stuff.h. #include "string-stuff.h" // These header files are required by the following functions. // Since this code needs the header files, #include them here. #include // for toupper() #include // for strlen() // Copy source to destination, but omit spaces. void remove_spaces(char to[], const char from[]) { char c; while ((c = *from++) != '\0') if (c != ' ') *to++ = c; *to = '\0'; } // Copy source to destination, but reverse the string. void reverse(char *destination, const char *source) { char *p = destination+strlen(source); *p-- = '\0'; while (*source) *p-- = *source++; *p = '\0'; } // Copy src to dst, converting to uppercase. void uppercase(char *dst, const char *src) { do { } while ((*dst++ = toupper(*src++))); }