Hello, this program produces an output I dont need, and im not sure how to get rid of it, and im guessing its because of 'd'. 'a' takes 'd' place as any number it seems, and because of that, one more calculation happens in display. 0(b) / (random number(a)). How can I fix it ?
I would guess, then, that there's some difference in the input format you're getting versus what you're expecting, but you didn't supply any input so... hard to say.
Please don't supply "decorated" input. Just the plain stuff as it appears in the file.
Make your while condition: while (getline(file >> std::ws, line))
You're mixing formatted and unformatted input extraction, and the first time the while loop is entered you have a newline from the previous input operation hanging around in the stream.
Coincidentally, changing that will make getline fail on an empty line which is what it was encountering previously at the end of the file, so testing the ss>>a expression isn't so critical if you can expect the format of the file to be correct otherwise.