I have one problem with this code please help me!
#include <stdio.h>
#include <cs50.h>
#include <string.h>
#include <ctype.h>
int main(void)
{
printf("Please, type your name: ");
string s=get_string();
int i=0;
if (s!=NULL)
{
printf("%c",toupper(s[0]));
while (s!=NULL)
{
if (s[i]==' ')
{
printf("%c",toupper(s[i+1]));
}
i++;
}
}
printf("\n");
}
I put as input: juan pablo and I get the following
~/workspace/pset2/ $ ./initials
Please, type your name: juan pablo
JPSegmentation fault
~/workspace/pset2/ $
----THEN I TRY USING THE CHECK50 AND I HAVE THE FOLLOWING ANSWER-> ~/workspace/pset2/ $ check50 ~/workspace/pset2/initials initials.c
Checking. invalid ID
~/workspace/pset2/ $