+ 2

what is the mistake in my code?pls..anyone?

#include <iostream> using namespace std; class cuboid{ public: int length,width,height; cuboid(int a,int b1,int c):length(a),width(b1),height(c){} void display(){ cout<<length<<" "<<width<<" "<<height<<endl; } }; class cuboidVol:public cuboid{ int l,b,h; void read_input() {l=length; b=width; h=height;} void display(){ cout<<l*b*h; } }; int main() { int n,i,l1,b2,h1;cin>>n; cuboid arr[n]; cout<<n<<endl; cuboidVol cv; cuboid *ptr=&cv; for(i=0;i<n;i++){ cin>>l1>>b2>>h1; arr[i](l1,b2,h1); ptr->display(); cout<<endl; } return 0; }

1st Apr 2020, 7:18 AM
Mahitha Reddy Maram
Mahitha Reddy Maram - avatar
4 ответов
+ 2
Make it on Sololearn Playground and here your Code because we can't recognise your problem without run the program
1st Apr 2020, 7:25 AM
A͢J
A͢J - avatar
+ 1
AJ#Level 20 End Day I did it on playground,but I'm unable to figure out the error
1st Apr 2020, 7:28 AM
Mahitha Reddy Maram
Mahitha Reddy Maram - avatar
+ 1
Mahitha Reddy Maram Share your Code here. And use @ before name to tag someone
1st Apr 2020, 7:32 AM
A͢J
A͢J - avatar
0
What is the error ?
1st Apr 2020, 7:25 AM
C0MM1T
C0MM1T - avatar