There are 2 classes defined as below
public class A
{
class B b;
}
public class B
{
class A a;
}
compiler gives error. How to fix it?
Answer Posted / santhosh
by Forward declaring,
class B;
public class A
{
class B b;
}
public class B
{
class A a;
}
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
Why is encapsulation used?
What does enum stand for?
Why do pointers exist?
How to use CMutex, CSemaphore in VC++ MFC
What does no cap mean?
What is the real life example of polymorphism?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
Why do we need oop?
Write a c++ program to display pass and fail for three student using static member function
What makes a language oop?
What are the three main types of variables?
Why is abstraction used?
What is abstraction and encapsulation?
write a program that takes input in digits and display the result in words from 1 to 1000
Advantage and disadvantage of routing in telecom sector