c read string with spaces from file code example
Example: read string with space c
char name[30];
char temp;
printf("Enter age: ");
scanf("%d", &age);
printf("Enter name: ");
scanf("%c", &temp); // temp statement to clear buffer
scanf("%[^\n]", name); // read until newline