Forums Register Login

Add elements to a Vector

+Pie Number of slices to send: Send
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:

Can someone tell me what is the correct syntax?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
This can't be correct:
Cabin cab(i)=
You want to do something like:
Cabin cabin =
+Pie Number of slices to send: Send
Peter, I don't think that I quite understand your question.
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 609 times.
Similar Threads
final keyword
Vectors
Vector array
Appending Vectors
Vector <Object>
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:59:45.