classes_practice++

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; class Box { public: double h,w,l; Box(double x,double y,double z){h=x;w=y;l=z;} Box(){} ~Box(){cout << endl << "you haven't seen the last of me";} double volume(){return (h*w*l);} //int a = []( int b ){ int r=1; while (b>0) r*=b--; return r; }(5); friend double mV(Box m); }; double multiplier=5; double mV(Box m) { return multiplier * m.volume(); } int main() { Box box(5,2,3); Box box1; box1.h = 1; box1.w = 1; box1.l = 1; cout << box.volume() << endl << box1.volume() << endl; cout << mV(box); }
Editor Settings
Theme
Key bindings
Full width
Lines