- #1
SpiffyEh
- 194
- 0
If you wanted to put ints, doubles, strings into your own container class how would you do it?
SpiffyEh said:If you wanted to put ints, doubles, strings into your own container class how would you do it?
A container class is a class that is used to store and organize data. It can hold different types of data and provides methods to manipulate and access that data.
By creating your own container class, you have control over how the data is stored and accessed. This can be useful when you have a specific way of organizing or manipulating the data that is not provided by existing container classes.
To put int or double into your own container class, you would first need to define a class that has the necessary data members and methods to store and manipulate this type of data. You can then use this class as a container for your int or double data.
Using your own container class allows for more control and customization in how your data is stored and accessed. It also allows for better organization and management of your data, potentially improving efficiency and performance.
The main drawback of using your own container class is that it requires more time and effort to create and maintain. Additionally, if your class is not well-designed or implemented, it may not perform as efficiently as existing container classes.