HI.. quick implementation question, first off i would like to say im new to the functionality of classes. I understand how they work, however I am having a problem.
What I need to do is read in a string of numbers, seperated by a character...
IE:
3 4 1 2 3 X 4 4 5 3 3 Q 5 5 6 7 3
I have one class:
What I need to do is read each group of numbers, and the following symbolCode:private: int num1,num2,num3,num4,num5; char letter;
into a sepeart instance of a class...
Thanks in advance for any help !!
IE.
class1 would read in 34123 X
class2 would read in 44533 Q
of each line...... Kind of like an associative array in respect to column numbers each structured as a class..
I just dont know how I can get multiple instances of a class to read in, and continue reading in properly..
IE:
Any help, or explation of how classes work in respect to istreams would be great...Code:class c1; class c2; class c3; while(!infile.EOF()) { c1.readfile(infile); // read first set of nums and char c2.readfile(infile); // read second set of nums and char c3.readfile(infile); // read third set of nums; } void class::readfile(istream &in) { in >> num1 >> num2 >> num3 >> num4 >> num5 >> letter; }
Im trying to have two instances of a class read different parts of a file at different points in the file;...



LinkBack URL
About LinkBacks



). Have you tried running your code?
All that work for nothing! lol
Always glad to be of service.