I have this text file, the format looks like this:
2 (no of modules) Module123 (Module code) Module100 5 Module123 (Module code) Module111 Module245 Module232 Module343
I want to read this into array of structure :
struct student {
int no_module;
--> how to declare variables for the module ?? <----
};
student a[];
file.open("data.txt" , ios ::in);
-->Because its based on the number of modules, if they are 2 , there are two modules which will be read or if they are 5 , there are 5 modules which will be read only. Anyone know how to read this text files ?
Thanks a lot.


Sign In
Create Account


Back to top









