RE: [Dev-C++] Help with creating objects dynamically
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Abhijit S. <mu...@gm...> - 2003-07-21 17:45:08
|
Hello, Satish.
> I have the following requirement while creating objects.. I will try to
> explain it using a small example..
Well, for one, you have to get it out of your head that the name of the
object changes its behaviour, or, for that matter, your understanding of the
program.
If what you want is to be able to tell who the student is from the object,
simply add a variable to store the name of your student:
class Student
{
// foo.
char *student_name;
};
And create some mutators/accessors/constructors/whatever that work with this
new member.
--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/
|