+ 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; }
4 ответов
+ 2
Make it on Sololearn Playground and here your Code because we can't recognise your problem without run the program
+ 1
AJ#Level 20 End Day
I did it on playground,but I'm unable to figure out the error
+ 1
Mahitha Reddy Maram Share your Code here. And use @ before name to tag someone
0
What is the error ?