:: Re: [DNG] Pointer error in the back…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Rainer Weikusat
Date:  
À: dng
Sujet: 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.