No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
3 Posted Topics
hi im asked to read data inputs from a text file in c. my problem is i dont know to separate the values, ex. may data contains these: 1.00:2.00:3.00 i would like to assign the values a = 1:00, b = 2.00, c =3.00. how is it done? thanks! | |
for example.. number.txt: (has these contents) 1.75:2.00:3.00 2.00:5.00:7.24 3.00:6.35:1.00 -- my source code is.. [code=c] #include <stdio.h> int main() { FILE *infile; double a, b, c; char d; double sum; infile = fopen("number.txt", "r"); if(infile == NULL) { printf("number DOES NOT EXISTS!"); } else { while(!foef(infile)) /*here's my problem*/ { … | |
for example.. number.txt: (has these contents) 1.75:2.00:3.00 2.00:5.00:7.24 3.00:6.35:1.00 -- my source code is.. #include <stdio.h> int main() { FILE *infile; double a, b, c; char d; double sum; infile = fopen("number.txt", "r"); if(infile == NULL) { printf("number DOES NOT EXISTS!"); } else { while(!foef(infile)) /*here's my problem*/ { fscanf(infile, … |
The End.