Mail Archives: djgpp/1997/11/18/22:02:08
Frank Kim wrote:
> I am migrating to djgpp from Borland C++, and I've found
> that
> djgpp doesn't like return by reference symbol "&". Is this true? thx
> in
> advance.
I can't quite follow what you're asking here. If you're asking whether
or not a function/member function can return a reference, then the
answer is absolutely yes.
It is, however, a bad idea to return a reference to a local variable,
viz.:
int &f(void)
{
int i;
// ...
return i;
}
This is bad for the same reason that returning a pointer to the same
variable would be bad -- after all, references are just an alternate way
of talking about pointers.
If you didn't mean either of these, the you'll have to post a (small!)
piece of code so that we can tell you why it isn't working.
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm://+37.20.07/-121.53.38
\
"Since when can wounded eyes see / If we weren't who we were"
/ Joi
- Raw text -