This is my code:
include cs50.h
include stdio.h
include ctype.h
int main(){
int i=0;
printf("");
char str[] = GetString();
printf("%c",*str);
while(str[i]!='\0'){
if ((str[i] > 96) && (str[i] < 123)){
str[i]=str[i]-32;
}
if(str[i]==' '){
i++;
printf("%c",*(str+i));
}
i++;
}
return 0;
}
When I want to make initials, it gives me this error:
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow initials.c -lcs50 -lm -o initials
initials.c:10:9: error: array initializer must be an initializer list or string literal
char str[] = GetString();
^
1 error generated.
make: *** [initials] Error 1
Please help me figure this out