Mail Archives: djgpp/1996/11/14/09:51:33
Ely Wilson (fletch AT netdoor DOT com) wrote:
: what I don't recognize is that double asterisk..*THAT* I've
: never seen...
If you suffix a type with '*', it becomes a pointer to that type. You can
suffix pointers with a '*' too, creating a pointer to a pointer to a type.
e.g. char is a char, char * is a pointer to a char, char ** is a pointer
to a pointer to a char [ C compilers read this as (char *)* ]. You can
consider any pointer to be an array, so this could also be read as a
pointer to an array of chars of an array of pointers to chars. It depends
how the memory is allocated and used. The above example, though, is
wrong, because it is allocating the size of a char for a pointer, which
may or may not work, and is not likely to be portable. It's almost certainly
not what the author intended.
--
George Foot
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ |""""""""""""""""""""""|
>Email: george DOT foot AT merton DOT ox DOT ac DOT uk < |Snail Mail:(*) |
> or: mert0407 AT sable DOT ox DOT ac DOT uk < | _ George Foot |
> Web: http://users.ox.ac.uk/~mert0407/ < |(@) Merton College |
> Ftp: mc31.merton.ox.ac.uk (#) < |~~~~ Oxford OX1 4JD |
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ |______________________|
(#) Theoretically... || (*) Please allow 28 days for delivery
- Raw text -