Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (line.at(i) == 's' && line.at(i + 1) == 'p') {
- if (isdigit(line.at(i - 3))) {
- int value;
- // line.at(i-3) and line.at(i-2) are two different numbers. I put them together by multiplying first by ten, then adding // the other one, but it gives me some random numbers
- value = ((line.at(i-3)) * 10 + line.at(i-2));
- cout << value;
- // this simply prints out the two numbers together. the print out here is correct.
- cout << line.at(i - 3) << line.at(i - 2) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement