| | |
Error reading file
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2005
Posts: 60
Reputation:
Solved Threads: 5
Just put the inside your while loop, and it shuld work.
C++ Syntax (Toggle Plain Text)
sum = sum+val; count=count++;
Don't forget to account for the first value:
On a side note, this is very, very wrong:
It modifies count twice between sequence points, which is undefined.
C++ Syntax (Toggle Plain Text)
if ( fin >> val ) { sum += val; ++count; min = max = val; while ( fin >> val ) { if ( val < min ) { min = val; } if ( val > max ) { max = val; } sum += val; ++count; } }
C++ Syntax (Toggle Plain Text)
count=count++;
I'm here to prove you wrong.
![]() |
Similar Threads
- First year assigment on reading file, sorting and outputting invoice (C++)
- Error reading in file in binary mode (C++)
- Error reading zip (PHP)
- Error Message Concerning Reading File From A Drive (C++)
- reading a file into code (Java)
- Error occured during the file system check. (*nix Software)
Other Threads in the C++ Forum
- Previous Thread: using stringstream for tokenizing a string
- Next Thread: Help! error LNK2001 & error LNK1120
| Thread Tools | Search this Thread |
api application array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting string strings temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






