:: Re: [DNG] Pointer error in the back…
Etusivu
Poista viesti
Vastaa
Lähettäjä: KatolaZ
Päiväys:  
Vastaanottaja: aitor_czr
Kopio: dng
Aihe: Re: [DNG] Pointer error in the backend of Netman
On Thu, Dec 10, 2015 at 01:11:21PM +0100, aitor_czr wrote:
> Hi Katolaz,
>
> In this case active_wifis is an argument passed by reference. So:
>
> active_wifis --> is the address
> *active_wifis --> is the value
>


Aitor, sorry for being pedantic on this, but "passing-by-reference"
exists only in C++, not in C. The only parameter passing in C is by
value. Then, you can pass an argument that is a pointer to a variable
instead of a variable, which "mimics" a pass-by-reference, but is
still a pass-by-value.

Hence, there is no way in C in which "p" and "&p" can be "the same
thing", especially if you have to decide to use either "p" or "&p" as
a first parameter of realloc...

HND

KatolaZ

--
[ Enzo Nicosia aka KatolaZ --- GLUG Catania -- Freaknet Medialab ]
[ me [at] katolaz.homeunix.net -- http://katolaz.homeunix.net -- ]
[ GNU/Linux User:#325780/ICQ UIN: #258332181/GPG key ID 0B5F062F ]
[ Fingerprint: 8E59 D6AA 445E FDB4 A153 3D5A 5F20 B3AE 0B5F 062F ]