Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CFile (as return value)

0 views
Skip to first unread message

Petar Popara

unread,
Jun 29, 2005, 8:36:04 AM6/29/05
to

Can I return CFile as func return value?

CFile myFunc()
{
CFile f(...);

return f;
}

CFile x = myFunc();

or it have to be pointer (CFile *)? Is there any way to avoid using
pointers?

I'm scared that some exception might occur and that I will not release it.


Guido Franzke

unread,
Jun 29, 2005, 8:44:04 AM6/29/05
to
Call by reference with &-Operator, you don't need pointers:

int CFile myFunc(CFile& f)
{
...
return 0;
}


"Petar Popara" <my....@mail.net> schrieb im Newsbeitrag
news:%23x4qMbK...@TK2MSFTNGP09.phx.gbl...

0 new messages