#include<iostream> class baseClass{ public: void a() {std::cout << "Base class atau Parent class" << std::endl;} }; class derivedClass : public baseClass{ public: void b() {std::cout << "Derived class atau Child class" << std::endl;} }; int main(){ derivedClass obj; obj.a(); obj.b(); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter