int price=' '; // attempt to grab a decimal number - but not the correct way
int itemnum=' '; // attempt to grab a whole number - but not the right way
while((price== (price*1.00)) && (itemnum == (itemnum*1)))
What is a way to get numbers in 2 diff columns where one column is whole numbers and the other are numbers with decimal places?
The best way would be to get each separately. If it is from a file then you can do this:
or
The >> operator is nice in C++ because it attempts to cast the input to whatever type you are using.
EDIT: Here is a small example for a file:
The file for this could have this data: 120 12.956 121 13.001 1402 12345.8
and the output would be: 120 12.956 121 13.001 1402 12345.8
It will work if the numbers are in columns too.