Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need to read in a text file which looks like this: 2 0.167 0.250 3 0.376 0.375 4

ID: 3620173 • Letter: N

Question

Need to read in a text file which looks like this:

2 0.167 0.250
3 0.376 0.375
4 0.668 0.500
5 1.043 0.625
6 1.502 0.750
7 2.044 0.875
8 2.670 1.000
9 3.400 1.128
10 4.303 1.27
11 5.313 1.41
14 7.65 1.693
18 13.6 2.257

into a 12-element (each line in the text file is an element) typedef struct array that looks like this:

typedef struct
{
int size;
double weight;
double diameter;
}astm;

I know how to write characters to and read characters from a file, but reading in data from a file that is then to be used is giving me trouble. Any help would be fantastic! If you need more info about the program just ask. Thanks!

Explanation / Answer

} I hope this will help you a bit =) Kind Regards !
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote