I am not very experienced with C++, so advance apologies if this is a silly question.
I have made a vector of class objects. I have done this because each time I run the code, I may need a different number of objects. For example, if the objects are chemical elements, I will need different elements for different reactions. I read the following post from this site for guidance: http://www.cplusplus.com/forum/beginner/63543/
I seem to be able to create a vector of the class objects and compile the code. For example:
As written in the example I provided, I get nElements by reading in data from an external file. I wondered whether this might be a problem. So as a test, I specified nElements by doing a specified number of "push_backs" to add to the vector and then doing:
for ( int i = 0; i < algorithm.size(); i++ )
I still got the segmentation fault.
I'm pretty sure there is nothing wrong with the Algorithm or gauss classes because everything works fine when I only have one object of class Algorithm. The trouble I'm having is when I want to have an arbitrary number of Algorithm objects.