Using 2 classes in a class

This is a discussion on Using 2 classes in a class within the C++ Programming forums, part of the General Programming Boards category; I'm using 2 classes in a class like so: Code: class a { public: class b { public: void c(); ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

    Using 2 classes in a class

    I'm using 2 classes in a class like so:

    Code:
    class a
    {
      public:
    
      class b
      {
      public:
        void c();
      };
    
      class c
      {
      public:
        void d();
      };
    
    };
    Now i can call the class b

    Code:
     a::b a_b;
    But not c
    Code:
     a::c a_c;

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Hmm...what compiler?

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    works for me. perhaps your compiler got confused. I'm using VC++
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    VC++, i tried it somewhere else in my program and there it
    does works..weird

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Class with pointers to other classes as member data.
    By Sclorch in forum C++ Programming
    Replies: 2
    Last Post: 02-09-2009, 04:59 AM
  2. deriving classes
    By l2u in forum C++ Programming
    Replies: 12
    Last Post: 01-15-2007, 04:01 PM
  3. Simple Question about Classes
    By Loctan in forum C++ Programming
    Replies: 5
    Last Post: 06-26-2006, 02:40 AM
  4. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  5. Array of classes within class definition
    By subdene in forum C++ Programming
    Replies: 1
    Last Post: 02-21-2005, 09:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21