Hi, I am writing a method that has to add several elements to a vector. Each element needs to be named differently off course. What I need to do is add a number to the instancename. like this:
What I find strange about the code is how you are using the Cabin class. You make a new Cabin each time through the loop. And I don't think you can do this:
You are creating an instance of the class and attempting to assign to it all at the same time. Make the class than call a set method to assign the primary key.