I've spent maybe 17 hours so far on this 8 of them straight. This is my code:
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void);
int i, n;
{
{
printf("Please enter your name. \n");
}
string name = GetString();
printf("%c", toupper(name[0]));
for ( int i = 0, n = strlen(name); i < n; i++)
{
if ( name[i] == ' ' && name[i + 1] != '\0')
{
printf("%c",toupper(name[i + 1]));
i++;
}
}
printf("\n");
}
I get this error:
~/workspace/pset2/ $ make Initials
clang -fsanitize=integer -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow Initials.c -lcrypt -lcs50 -lm -o Initials
Initials.c:8:1: error: expected identifier or '('
{
^
1 error generated.
make: *** [Initials] Error 1
Please help!!!
Any other tips to improve my code would be greatly appreciated!
-Jonathan