This code declares a class Outer that contains another nested class Inner. The Inner class has a member function display() that simply prints "Display Inner :" to the console. In the Outer class, there is a member function fun() which simply calls the display() function of the member object i of the Inner class.
In the main() function, an object of Inner class is created using the scope resolution operator :: and stored in the variable i. However, this object is not actually used and the program simply exits without performing any operations. Therefore, the code doesn't really do anything useful and can be considered incomplete.
#include<iostream> //Doubt using namespace std; class Outer { public : void fun() { i.dispaly(); } class Inner { public: void dispaly() { cout<<" Display Inner :"<<endl; } }; Inner i; }; int main() { Outer :: Inner i; return 0; }To download raw file Click Here
Display Inner
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions