well it's pretty simple.
let's store the string in an array:
char str="This is a test string";
and store the result in some other array:
then use a for loop to detect when does the first "space" comes. The string of characters which comes before the first space will be the first word.
the for loop exits when the condition str[i]!=" " becomes false.
so your result is stored in result.
Hope you understood how it worked which is more important!