Hello,
i am posting the code with local classes. Please tell me how to access methods of local classes via the main class??
Code:
#include <iostream.h>
#define N 10
class A
{
class B
{
int data;
public:
void setdata(int d);
void putdata();
}b;
public:
void setdata();
void putdata();
};
void A::putdata()
{
B::putdata(); //how to access local class member function?
}
}
void A::setdata()
{
B::setdata(10); //how to access local class member function?
}
void A::B::putdata()
{
cout<<data;
}
void A::B::setdata(int d)
{
data=d;
}
int main(void)
{
return 0;
}
how shall i access the local classes member functions?