israo
March 31st, 2008, 07:53 AM
Hello,
I am a novice in the c++ programming world, and only occasionally do some bit of programming for my students. We prepare marks list in excel or word for our students. The tables will have student name, number, marks in subjects. I want to use the marks from those tables in a c++ programme. I copied the relavant fields as a separate file (though in tabular form, not tables, as I used notepad), and wrote some programmes to read from the file using the file pointer and getc(). That much worked. But if I want to copy the records into some variables, so that I can work on them how should I proceed? Suppose the marks are
Roll_No Maths History Science
101 48 44 40
103 35 40 38
104 37 39 41
How can I access them. I know the fields, and the type (int or char). So I can create suitable class. But when I read from the file, using the binary file open, the spaces are also read, or only part of the file is read. why?
I am a novice in the c++ programming world, and only occasionally do some bit of programming for my students. We prepare marks list in excel or word for our students. The tables will have student name, number, marks in subjects. I want to use the marks from those tables in a c++ programme. I copied the relavant fields as a separate file (though in tabular form, not tables, as I used notepad), and wrote some programmes to read from the file using the file pointer and getc(). That much worked. But if I want to copy the records into some variables, so that I can work on them how should I proceed? Suppose the marks are
Roll_No Maths History Science
101 48 44 40
103 35 40 38
104 37 39 41
How can I access them. I know the fields, and the type (int or char). So I can create suitable class. But when I read from the file, using the binary file open, the spaces are also read, or only part of the file is read. why?