[Issue 1869] Semantically returning an array from a funciton is difficult

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 25 17:24:06 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1869





------- Comment #8 from andrei at metalanguage.com  2008-02-25 19:24 -------
(In reply to comment #7)
> but that still doesn't solve the base issue: I want a function to return a
> pointer to a chunk of memory that is 4 ints in a row (or it is that as best the
> compiler can tell).
> 
> (Err. I hope that is understandable)

I don't understand. Doesn't this work?

int[4]* foo() {
    static int[4] x;
    return &x;
}

?


-- 



More information about the Digitalmars-d-bugs mailing list