Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reference as return type.
#3
Yeah. I just got some kind of a glitch.

Now i am curious about - is there some kind of garbage collector.

extern void object::Spider2()
{
int[] q;
q = qw();
message(q[2]);

}

public int[] qw()
{
int testarray[]={1,2,3,4,5};

return testarray;
}


If am i correct - with every call of function a brand new array will be created?
And last but one will stay in memory without link on it. - with means wasted memory?
Can you advise me about this things?


Messages In This Thread
Reference as return type. - by clop1000 - 07-04-2016, 03:34 PM
RE: Reference as return type. - by krzys_h - 07-04-2016, 03:51 PM
RE: Reference as return type. - by clop1000 - 07-04-2016, 04:22 PM
RE: Reference as return type. - by krzys_h - 07-04-2016, 04:40 PM
RE: Reference as return type. - by clop1000 - 07-04-2016, 05:14 PM
RE: Reference as return type. - by krzys_h - 07-04-2016, 07:12 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)