Link to home
Start Free TrialLog in
Avatar of chuyan
chuyan

asked on

how to use "getline"?

how to use the function "getline" in order to get a string input from keyboard?

moreover, how to change an infix math expression to postfix by using stack?
e.g. 1 + 2 * 3
will be
1 2 3 * +

tks!!
Avatar of newexpert
newexpert

cin.getline(char *yourbuf, int max_length_allowed, char line_terminator_to_look_for);

If you use the latest STL, then it's simply cin.getline(string your_string, char terminator);
Avatar of chuyan

ASKER

oh yup! tks!!
Avatar of chuyan

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chuyan

ASKER

tks!