cin>>stu.Phone;
Is fetching an integer from the command line so it doesn’t read the \n
character at the end which getline
reads immediately after.
Before getline
, write fgetc(stdin)
to read the newlîne.
CLICK HERE to find out more related problems solutions.