Hi,
I have two questions,
1. The following program will not compile if the 'public' is not 
defined. why?
2. Since pa is pointed to nowhere, is it a safe to use pa without 
the instanciate the class a?

thanks,

--- code starts here ---

#include<iostream>

using namespace std;
class a{
        public:
                void print(void) { cout << "a print\n";}
};
class b{
        public:  // error if this line is commented out.
        a* pa;
};

int main(void)
{

        b b1;
        b1.pa->print();
}

Reply via email to