#include <stdio.h>
#include <string.h>
void print_first_letter(char str[], char* delimiter) {
char* word = strtok(str, delimiter);
while (word != NULL) {
printf("%c\n", word[0]);
word = strtok(NULL, delimiter);
}
}
int main(void)
{
char s[] = "C is a general purpose procedural computer programming language";
print_first_letter(s, " ");
return 0;
}
/*
run:
C
i
a
g
p
p
c
p
l
*/