str- an array of 25 pointers to char, not an array char. So change his ad to
char str[25];
And you cannot use scanfto read sentences - it stops reading in the first space, so use fgetsto read sentences.
printf %c , %s.
, stdin '\n', .
#include <stdio.h>
void flush();
int main()
{
char str[25], car;
printf("Enter a character\n");
car = getchar();
flush();
printf("Enter a sentence\n");
fgets(str, 25, stdin);
printf("\nThe sentence is %s, and the character is %c\n", str, car);
return 0;
}
void flush()
{
int c;
while ((c = getchar()) != '\n' && c != EOF)
;
}