:: Re: [DNG] Pointer error in the back…
Top Pagina
Delete this message
Reply to this message
Auteur: Rainer Weikusat
Datum:  
Aan: dng
Onderwerp: 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.