How can two classes uses each other without violating declaration before use? Can you give me an example?
compsci91
0
Newbie Poster
Recommended Answers
Jump to PostOnly limited way can class A use class B before class B is declared, class A can declare a pointer to an object of class B but that's about the extent of it.
class B; // pre-declare class class A { public: B* b; // declare a …
All 3 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
compsci91
0
Newbie Poster
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.