I my main function, the use is asked to input certain information( M#,Mesh#, and object name), however the questions are not displaying correctly on the screen.This is what the output looks like:
>> ignores leading white space and stops when a trailing white space is found (or extraction failure) but doesn't remove the found white space.
getline() extracts data until the specified delim is found (default '\n') and removes the delim. It doesn't skip leading white space.
So if a cin is used first, the terminating \n is left in the buffer which is found by getline() as terminating the data get. If you mix >> with getline(), you need to also remove the '\n' left by >> before the getline(). This is usually done by .ignore(). Often used as .ignore(1000, '\n') in case there are more than one white space chars left after the >> extraction.