Local variable disappears.
bauss
jacobbauss at gmail.com
Mon Dec 22 17:05:16 UTC 2025
On Monday, 22 December 2025 at 17:03:48 UTC, SarK0Y wrote:
> On Monday, 22 December 2025 at 16:54:56 UTC, bauss wrote:
>> On Monday, 22 December 2025 at 13:53:54 UTC, SarK0Y wrote:
>>
>> You have this wonderful line nuking your memory:
>>
>> ```
>> *map = 0;
>> ```
> Thanks for Your reply, but i disagree..
>
> ```D
> map.name = "name1";
> *map = 0; // if it torpedoes memory
> map.prnt; // then sigsegv must be here
> simply_print_time ("start tst for __emp");
> map.prnt; // but it's here
> ```
It is undefined behavior, so it can happen at anytime, anywhere.
More information about the Digitalmars-d-learn
mailing list