158. Write a program to demonstrate nested class?

#include<iostream.h> #include<conio.h> class outer { private:                 int n; public:                 void read()                                 {                                 n=10;                                 }                 void display()                                 {                                 cout<<"N = "<<n<<endl;                                 }                 class inner                 {                 private:                                 int l;                 public:                                 void read()                                                 {                                                 l=20;                                                 }                                 void display()                                                ... Continue Reading →

Advertisements

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: