why is a string variable not taking input from a structure to a function?

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.

Leave a Comment

Your email address will not be published.

Scroll to Top