:: Re: [DNG] Pointer error in the back…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Rainer Weikusat
Datum:  
To: dng
Betreff: 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.