scanf ("%[^ ]%*c", name);
char name[30]; char temp; printf("Enter age: "); scanf("%d", &age); printf("Enter name: "); scanf("%c", &temp); // temp statement to clear buffer scanf("%[^ ]", name); // read until newline