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 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

15th Mar 2017, 11:26 AM
Phát Tấn Phát
Phát Tấn Phát - avatar
4 Answers
+ 3
can say ur problem in details?not understanding ur question:-(
18th Mar 2017, 4:59 AM
sadiya zainab
sadiya zainab - avatar
+ 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];
18th Mar 2017, 5:38 AM
sadiya zainab
sadiya zainab - avatar
+ 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(); } }
18th Mar 2017, 5:08 PM
sadiya zainab
sadiya zainab - avatar
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()???
18th Mar 2017, 5:32 AM
Phát Tấn Phát
Phát Tấn Phát - avatar