:: Re: [DNG] Pointer error in the back…
Forside
Slet denne besked
Besvar denne besked
Skribent: Rainer Weikusat
Dato:  
Til: dng
Emne: Re: [DNG] Pointer error in the backend of Netman
aitor_czr <aitor_czr@???> writes:

> I rectify:
>
> p = &x;     // This is -> *p=5


Considering

>> int x = 5;
>> int *p, *q;
>>
>> p = &x;     // This is -> p=5


it's not. It's p = &x. Afterwards, *p will return whatever value x
happens to have. Prior to the assigned, p was (assuming auto variables)
a pointer with an indeterminate value and using that for anything, as in

*p = 5

is undefined behaviour.