zeus
out of date
Ive been following this tutorial but dont really get the point made in the stringstream section.....
Basic Input/Output
Am I right in thinking all the code is doing (right at the bottom of the page) is saving the getline variable as a string called mystr then converting it with stringstream into a numerical variable called price.
Then the same for quantity.
Why not just save the numbers as variables and multiply those. I dont get the point in saving it as a string and then turning it into a number.
But maybe ive got it all wrong!
Basic Input/Output
Am I right in thinking all the code is doing (right at the bottom of the page) is saving the getline variable as a string called mystr then converting it with stringstream into a numerical variable called price.
Then the same for quantity.
Why not just save the numbers as variables and multiply those. I dont get the point in saving it as a string and then turning it into a number.
But maybe ive got it all wrong!