[Issue 890] Returning char[4] and assigning to char[] produces unexpected results.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 26 01:49:33 PST 2007


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


bugzilla at digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from bugzilla at digitalmars.com  2007-01-26 03:49 -------
It fails because statically dimensioned arrays, like char[4], are allocated on
the stack, and the return statement is returning a reference to that stack
variable. When the function returns, the stack variable becomes garbage.


-- 



More information about the Digitalmars-d-bugs mailing list