Access to Nested class


Hi
Is the below access is possible.
The below code is in say Example1.h

class Outer
{
public:
class Inner
{
};
};

If i use the below code in Example2.h

#include "Example1.h"

class Extend
{
MoMediaGateway::Data *ltmp; // gettin error here due to inner class scope.
};

Some one help me by a hint how we can user inner class from outside.

REgards
vijay

Comments

  • :
    : Hi
    : Is the below access is possible.
    : The below code is in say Example1.h
    :
    : class Outer
    : {
    : public:
    : class Inner
    : {
    : };
    : };
    :
    : If i use the below code in Example2.h
    :
    : #include "Example1.h"
    :
    : class Extend
    : {
    : MoMediaGateway::Data *ltmp; // gettin error here due to inner class scope.
    : };
    :
    : Some one help me by a hint how we can user inner class from outside.
    :
    : REgards
    : vijay
    :


    You must have left something out of your post because I don't see any relationship between MoMediaGateway and the Outer / Innner class you posted.
  • [b][red]This message was edited by tsagld at 2006-8-31 1:58:56[/red][/b][hr]
    :
    : Hi
    : Is the below access is possible.
    : The below code is in say Example1.h
    :
    : class Outer
    : {
    : public:
    : class Inner
    : {
    : };
    : };
    :
    : If i use the below code in Example2.h
    :
    : #include "Example1.h"
    :
    : class Extend
    : {
    : MoMediaGateway::Data *ltmp; // gettin error here due to inner class scope.
    : };
    :
    : Some one help me by a hint how we can user inner class from outside.
    :
    : REgards
    : vijay

    Anyway, it seems somewhat awkward to have a nested class that has to be accessed from another class than the parent or siblings.
    I would consider changing the architecture.
    But you may try making the outer class public.


    Greets,
    Eric Goldstein
    http://www.gvh-maatwerk.nl




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories