Re: Dynamic changing values at a GtkTreeStore with pointers



On Sun, 25 Mar 2007 05:17:50 -0300 Diogo wrote:
>  It is a little confusing to me
> because I assume that POINTERS are address and address are passed using
> & key.

No, wrong. Addresses are *passed* exactly like any other type is passed. Addresses can be *obtained* using the & operator. Hence:

   char jim;
   char * fred;
   fred  = &jim;

Means:

   "jim" is a variable of type "char"
   "fred" is a variable of type "pointer to char"
   Assign to "fred" the value obtained by applying the "take address of" operation on "jim". Or "make fred point to jim" for short.

Of course, C++ goes and f*£$s with your understanding by _also_ using & to mean "pass by reference", where reference *is not* the same as address. This is one of many places where C++ is a very bad OO language. Its use of "polymorphism" is horribly broken.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]