| | |
Nugget? reading different int from a file
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 2
Reputation:
Solved Threads: 0
I have a file first line contains three int's.
(These are the vari's I assigned)
numStudents
numScores
total
--I AM CONFUSED HERE-
{
in >> numStudents >> numScores >> total;
}
- Here I am mentally not getting it. I need to read the line in the file as a (??) str or separate ints.
I know the data format in the file will always be (for example) :
5 6 600
1542 95 91 92 88 100 90
9328 91 85 88 89 82 91
3902 79 82 85 84 80 81
5801 88 84 86 89 93 92
6829 80 78 85 73 76 79
SO 5 6 600 are the vari's I named above. I donot see how to read 3 separate values, store them but not add them.
No I am not a good programmer.
Any input is helpful.
Thx.
(These are the vari's I assigned)
numStudents
numScores
total
--I AM CONFUSED HERE-
{
in >> numStudents >> numScores >> total;
}
- Here I am mentally not getting it. I need to read the line in the file as a (??) str or separate ints.
I know the data format in the file will always be (for example) :
5 6 600
1542 95 91 92 88 100 90
9328 91 85 88 89 82 91
3902 79 82 85 84 80 81
5801 88 84 86 89 93 92
6829 80 78 85 73 76 79
SO 5 6 600 are the vari's I named above. I donot see how to read 3 separate values, store them but not add them.
No I am not a good programmer.
Any input is helpful.
Thx.
I'm confused, too.
Confusion #1: Why don't new posters ever read the post Read Me: Read This Before Posting? Isn't the title explicit enough?
Confusion #2: No idea what your problem is. I have no idea what "I donot see how to read 3 separate values, store them but not add them" means. It can't be something as simple as just don't add them, I assume.
Confusion #1: Why don't new posters ever read the post Read Me: Read This Before Posting? Isn't the title explicit enough?
Confusion #2: No idea what your problem is. I have no idea what "I donot see how to read 3 separate values, store them but not add them" means. It can't be something as simple as just don't add them, I assume.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
![]() |
Similar Threads
- RE: reading .wav file and putting ito inot the array (C)
- Need help reading and writing to file (C++)
- Reading .dat file (Visual Basic 4 / 5 / 6)
- Reading an input file as a class memeber function (C++)
- reading txt file into array (C++)
- Not reading in entire file. (C++)
- URGENT - Reading from txt file into a 2 dimension array (Java)
- problem reading text file to struct (C++)
Other Threads in the C++ Forum
- Previous Thread: Help picking numbers out of an array/string
- Next Thread: Separate Compilation
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data delete deploy desktop developer directshow dll download dynamic encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node number output parameter pointer problem program programming project proxy python read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






