I'm new to c and need to take in a string (char *) and cut it down into its individual words. I'm not sure what the most efficient way to do this would be. For example if given the string "This is a string", I need to turn it into the four strings "This", "is", "a", and "string". There will only be a maximum of 4 words in the input string, so I'm trying to figure out what the best strategy would be. Thanks for any help.
I'm also kind of confused about how a char * can point to a string. Why isn't it just a pointer to one character? Thanks.