Oh totally sorry about that. I didn't even need to be using that anyway. I rewrote the program from scratch. Here is the new code.
Code:
#include <stdio.h>
#include <cs50.h>
#include <string.h>
#include <ctype.h>
int main(void)
{
// Prompt the user to type their full name.
printf("What is your full name? ");
string s = get_string();
// Checks if the string is not NULL.
if (s != NULL)
{
// Iterate over the characters one at a time.
for (int i = 0, n = strlen(s); i < n; i++)
{
// Checks to see if s[i] is a space character.
if (s[i] == " ")
// Prints the first letter, and the letters after the space character.
printf("%c%c%c", s[0], s[i+1], s[i+1]);
}
}
printf("\n");
return 0;
}
I'm getting an error when I try to run it though.
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:22:22: error: result of comparison against a string literal is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
if (s[i] == " ")
^ ~~~
initials.c:22:22: error: comparison between pointer and integer ('int' and 'char *') [-Werror]
if (s[i] == " ")
~~~~ ^ ~~~