J
john
I am VERY new to C++ (1st semester) put not so new to coding and
programming (SQL, VB, etc). We are learning about classes.
I have a program that needs to call many instances (i think this is the
right term) of a class.
What I have been taught so far is to write to a class we would do
something like this in the main.cpp:
a1.setmanSalary(something);
of course all the appropiate coding is set in the class and class body
to handle it.
well, the program I need to write requires that the user does not know
how many entries they would have to enter (employees in this case).
So....In order for me to do this I would have to do:
a1.setmanSalary(something);
a2.setmanSalary(something);
a3.setmanSalary(something);
a4.setmanSalary(something);
etc.... all the way to some huge number
How can I set this up so the class instance
(aX.setmanSalary(something) can be dynamically created so the program
can make the instances as it is needed? Let me know if you need more
info i will try to explain this better. I dont have to use a class for
this but I am choosing to so I can get a better understanding of it.
Thanks in advance!
programming (SQL, VB, etc). We are learning about classes.
I have a program that needs to call many instances (i think this is the
right term) of a class.
What I have been taught so far is to write to a class we would do
something like this in the main.cpp:
a1.setmanSalary(something);
of course all the appropiate coding is set in the class and class body
to handle it.
well, the program I need to write requires that the user does not know
how many entries they would have to enter (employees in this case).
So....In order for me to do this I would have to do:
a1.setmanSalary(something);
a2.setmanSalary(something);
a3.setmanSalary(something);
a4.setmanSalary(something);
etc.... all the way to some huge number
How can I set this up so the class instance
(aX.setmanSalary(something) can be dynamically created so the program
can make the instances as it is needed? Let me know if you need more
info i will try to explain this better. I dont have to use a class for
this but I am choosing to so I can get a better understanding of it.
Thanks in advance!