| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
HELP!! Output a whole line of data.
Hi, my task is to input data from a txt file and output the results to
another txt file. I have to work out an average for different students then OUTPUT the student with the largest average. I don't understand which codes to use. So my output is something like: studentID>>firsname>>surname>>average; Please advise, Thank You |
|
#2
|
|||
|
|||
|
look into the fstream standard library. it helps with file input/output in C++.
|
|
#3
|
|||
|
|||
|
I don't get you. My teacher advised to use struct. but i dnt kno how to use it on my case.
|
|
#4
|
||||
|
||||
|
Do you know what a structure is?
The data in the file is probably organized in a logical, consistant pattern, and thus you can use a a structure to read in the chunks one at a time, one for each student....
__________________
Officially a member of the Itsacon fan club. Beer blasts are every friday at Viper_SB's house. I bring the chips. ![]() |
|
#5
|
|||
|
|||
|
i kind of kno w what struct does. But does that mean i should
use struct to input data aswell as output. Because ive only thought of using struct to output. thnks anyway |
|
#6
|
||||
|
||||
|
just as you can read in and out of a normal variable, you can also read into and out of a struct....
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > HELP!! Output a whole line of data. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|