|
Re: I kind of need help on my program
Quote:
|
Originally Posted by verizondude
What we want to do is to make a struct that can be remade into diffrent type of that struct. Like you want to add a new student to your database. we use the student struct to get his information. we want it so that all the diffrent students have a diffrent struct so that we dont have manually add a new struct every time some is new. so its automated.
|
Ahh. what you want, then, is a collection of structs. The simplest is an array or vector. As you seem to have already covered arrays, just use one of those. A vector is a type from the standard template library that is an abstraction of an array; it provides very similar functionality, with some added perks such as range-checking and the ability to be resized.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp
|