Need help

Hello
I need help with my c++ code

I wrote the statement that makes it read from a file
which was
file>>cust.numcust>>cust.arrtime;

"As file is the name of the file"

but he never reads from the file
and while debugging and after executing the the statement it sets the cust.numcust as zero

what can I do??

Thanks in advance
ifstream infile;
infile.open ("input.txt");
infile>>cust.numcust>>cust.arrivetime>>cust.svctime>>cust.per;

What's wrong with the statements above??
what can I do??
Check whether the file could be opened

What's wrong with the statements above??
compiler/linker error? Something else?
Although the statements above have no syntax errors, the program could not run!!!!

I don't know where is the problem
Did you check if the file was open, as coder777 suggested?
yes I did
You should post the whole block of code and not just one line.
ok I'll try to post the whole block of code
It's very long
Thanks to you all :)
Finally the file was opened

But I still have a question
the file contains 4 lines of inputs
how can I make it read from the file line b line

till now it reads only the first line
how to make it read the next line each iteration in the loop???
this should be possible within a loop without modification.

We can't tell you what's wrong if you don't post the relevant code. That above is not enough.

Please use code tags: [code]Your code[/code]
See: http://www.cplusplus.com/articles/z13hAqkS/
Topic archived. No new replies allowed.