Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why is encapsulation used?

1054


What does enum stand for?

1185


Why do pointers exist?

1151


How to use CMutex, CSemaphore in VC++ MFC

4835


What does no cap mean?

1116


What is the real life example of polymorphism?

1233


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?

2450


Why do we need oop?

1273


Write a c++ program to display pass and fail for three student using static member function

3463


What makes a language oop?

1127


What are the three main types of variables?

1178


Why is abstraction used?

1137


What is abstraction and encapsulation?

1060


write a program that takes input in digits and display the result in words from 1 to 1000

2487


Advantage and disadvantage of routing in telecom sector

1352