Ok I have a .txt that i need to read in. Each line of the .txt is formatted like
1 1 0 2 5
9 3 1 5 4
2 6 2 1 8
Each of these numbers are specific attributes. As I read in each line i need to assign each number to a specific attribute in a constructor. Any hints on how to make this constructor?
Is not a good idea having the file I/O in the class constructor.
I suggest you reading everything in a container ( eg: deque http://www.cplusplus.com/reference/stl/deque/ ) and then passing it to the constructor
@Bazzy:
Why it isn't good idea? (It worked properly for me.) If you have to read the settings from an ini file? Where do you want to put the reading when starting the program ?
It works but the file may be renamed/changed in format or such things. If you really want to read it from within the constructor, you should at least pass the file name as argument.
A container will allow you holding a variable amount of numbers.