Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 2 3
- 2 1
- 3 1
- int getNumber(ifstream &input, string &inputStr, char &nextChar) {
- inputStr.clear();
- // Append digits to the string until either a space or newline is encountered.
- while(nextChar != ' ' && nextChar != 'n')
- {
- inputStr.append(1, nextChar);
- input.get(nextChar);
- }
- int number = stoi(inputStr);
- return number;
Add Comment
Please, Sign In to add comment