Simple list class question

This is a discussion on Simple list class question within the C++ Programming forums, part of the General Programming Boards category; I have a list which is for storing all the data, same as normal class, have something like .get() and ...

Simple list class question

I have a list which is for storing all the data, same as normal class, have something like .get() and .set() for getting and setting value to the list in the program. However, at the moment, I can only predefined the size of the list within the code. How may I put the definition in the function itself so the size of the list may depends on the input?

And may I ask another question, why in modulation the definition of variable is not in the main but in the individual module?

#3 On to the meat of your question... you should be able to easily use one of the readily available STL container classes to hold all of your vacancylist objects. These containers, such as list/vector/deque, can grow automatically to accommodate as many objects as you would need.

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens

Now the printing of objects is more intuitive using the above overloaded operator, it's just like using cout to print an int but instead we will be printing a vacancylist object since we've now told the computer how to output a vacancylist object using operator<<...

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens