CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Nov 2008
    Posts
    18

    Code can't find previously defined class

    I have a file that has several class delcarations in it. It looks like
    Code:
    class A : public B
    {
    public:
      virtual int call (void)
      {
        stuff;
        return -1;
      }
    };
    
    class C : public D, private E
    {
      stuff;
    };
    
    int C::foo(void)
    {
     A *req;
     return 0;
    }
    When I try to compile, at "A *req" I get identifier "req" is undefined. But req isn't the identifier, A is. So it looks like it can't find A. But why wouldn't it find it. It's in the same file.
    Last edited by homer_3; July 21st, 2009 at 02:59 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured