:: Re: [DNG] Pointer error in the back…
Pàgina inicial
Delete this message
Reply to this message
Autor: Rainer Weikusat
Data:  
A: dng
Assumpte: 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.