Link to home
Start Free TrialLog in
Avatar of supportoranges
supportorangesFlag for United States of America

asked on

Reference going out of scope impact to actual object being referred to

In the following ex:

int myClass::getBeer(void)
{
  MyBuddy& refBuddy=getABuddy(true);
  refBuddy.getMoreBeer(1,2);
  return 0;
}
when refBuddy goes out of scope will it delete the actual object referenced?  I remember something horrible once happened along these lines and want to avoid a repeat performance.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of supportoranges

ASKER

Thanks so much for clarifying.  It is really appreciated!