#include<iostream> struct A { void a(); }; void A::a() {std::cout << "Fungsi dari struct A" << std::endl;} class B { public: void b(); struct A c; }; void B::b() {std::cout << "Fungsi dari class B" << std::endl;} int main(){ B obj; obj.b(); obj.c.a(); 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