0
I can't use the file's include. Sr i speak english. Add friend and help me if you have free time. Help me learn english and code
Help
4 Réponses
+ 3
can say ur problem in details?not understanding ur question:-(
+ 3
what error you are getting?you want to read array of elements or just one person bcoz for array of elements its syntax is
classname *pointervariable=new classname[size];
+ 3
base class is student and derive class is people ,you want to use same method name in both the classes??
class student
{public:
virtual void read()
{}
};
class person:public student
{public:
void read()
{}
};
int main()
{
student *s=new student[10];
person *p=new person[10];
for(I=0;I<10;I++)
{
s[I].read();
p[I].read();
}
}
0
Can u help me. When i use class student base class people. I have method void read() in class people. I want rewrite in class student.in main i have array of people. . . But if i use new void read() i can use method void read() in class student.
Error
People p;
People p2=new people();
P=new student();
Student p3=new student();
P1,p2,p .read();
P1.read() == p2.read()???