What does program do when array is returned from function?

tcak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 4 00:03:30 PDT 2015


[code]
char[] test(){
    auto t = new char[5];

    return t;
}
[/code]

Is the test function returning just a pointer from heap or does 
copy operation?

It is not obvious what it does, and I am trying to avoid doing 
this always.



More information about the Digitalmars-d-learn mailing list