/** * print-sequential-prefixes.c - An implemenation of * print_sequential_prefixes. Designed as part of a sample solution to * assignment 7. */ // +---------+-------------------------------------------------------- // | Headers | // +---------+ #include // For printf #include // For strchr #include "string-utils.h" // For print_sequential_prefixes // +--------------------+--------------------------------------------- // | Exported Functions | // +--------------------+ void print_sequential_prefixes (char *str, char ch) { // Repeatedly print prefixes until you reach the end of the string do { // Print the string printf ("%s\n", str); // Move on to the next prefix. str = strchr (str+1, ch); } while (str != NULL); } // print_sequential_prefixes