Hi, Basically I have a file that has numbers in and i need them to be read into my code ( which i thought i had done correctly) but it doesnt seem to be happening. The numbers are displayed in 2 collumns. Once read they need to be used in the calculation and outputted onto the screen I am having alot of difficulty with this can any one help? The numbers in the file go like this
4
3 2
5 7
Don't think you need this line #include "stdafx.h"
This looks wrong to me cout >> fullamount;
This appears to have no purpose int rm = 500;
Another line with no purpose. fullamount = payslip;
You don't need both of these, use one or the other
1 2
std::getline(in_file,x);
in_file >> numberneeded;
If i'm guessing right, this line needs to be before your while loop. in_file >> numberneeded;
So I'm guessing that the first number is the number of remaining numbers in the file. Don't know why you would have that but it's your homework I guess you have a reason.
You really need to learn to trouble shoot your own code.
Next time think about it first, then write it. For the most part you had it right but you had several lines that simply wasn't needed and I think that came from writing the code without thinking it though.