Return first letter of each word capitalized | C : I'm learning C for fun, I just started and I'm trying to write a function to take a string, and return the first letter of each word capitalized. 
Eg: 'The sun in the sky' => TSITS

Here is my code, after tinkering quite a bit I manage to be able to compile; but seems like it only print the spaces of the string

    #include <stdio.h>
    #include <string.h>
    #include <ctype.h>
    
    int main(void)
    {
        string s = GetString();
        
        for (int i=0;i<strlen(s);i++){
            if(i == s[0] || s[i-1] == ' ' ){
                s[i] = toupper(s[i]);
                printf("%c",i);
                i++;
            }
        }
    }

What's wrong with it? Thanks in advanced :)