Nugget? reading different int from a file

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 2
Reputation: brian@oit is an unknown quantity at this point 
Solved Threads: 0
brian@oit brian@oit is offline Offline
Newbie Poster

Nugget? reading different int from a file

 
0
  #1
Nov 15th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Nugget? reading different int from a file

 
0
  #2
Nov 15th, 2007
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.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2
Reputation: brian@oit is an unknown quantity at this point 
Solved Threads: 0
brian@oit brian@oit is offline Offline
Newbie Poster

Re: Nugget? reading different int from a file

 
0
  #3
Nov 15th, 2007
Thanks,
Happy geek will delete me.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC