## Goal ```c++ char** camel_caser(const char *input_str); ``` * Input: a string. * Output: an array camel-cased string.

Example

  • Input
    • I am Steve. I am a master stduent in uiuc.
  • Output
    • ["iAmSteve", "iAmAMasterStudentInUiuc", NULL]
### Why null-terminated array? * Easier to know the size of the array. * Easier to traverse.
### Example ```c++ char* input = "I am steve. I am a master stduent in uiuc." char ** output = camelCaser(input); char** ptr = output; for(; *ptr!= NULL; ++ptr) { printf("%s\n", *ptr) } ```
### Example - Output ```c++ SteveLee@SteveLees-MBP:~/extreme_edge_cases$./camelCaser iAmSteve iAmAMasterStudentInUiuc ```
# Development
## Development * Design before you start to write your code. * Re-design your code when you are using too many if/else statement. * Re-design your code when you found yourselves writing a lot of similar codes.
## Development - 2 * Test-Driven development. * Write tests RIGHT after you finish one or two functions.
# Hints
## Hint 1 * What is _GNU_SOURCE? * If you #define _GNU_SOURCE * You get the access to non-standard GNU extension functions. * Example: strdup
## Hint 2 * Useful functions: * strdup: return a string copy. * strcpy/strncpy: copy a string to another string. * int toupper/int tolower: return the upper/lower of input. * ispunct/isspace/isalpha: decide whether it is punct/alpha/space.
## Hint 2 - Example ```c++ char* dup_str = strdup("I want to copy this"); size_t str_size = strlen(dup_str) + 1; char* dest_str = (char*) malloc(sizeof(char)* str_size); // dest , source // copy from source and put into dest strncpy(dest_str, duplicate_str, str_size); //up = 'C' char up = toupper('c'); ```
## Hint 3 * Read the document very carefully. * Start early. * Play with the reference.