www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/14/09:51:33

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: array of pointers to strings, BC++, DJGPP and weird printing , behavior
Date: 11 Nov 1996 13:54:42 GMT
Organization: Oxford University, England
Lines: 28
Message-ID: <567b72$crl@news.ox.ac.uk>
References: <Pine DOT GSO DOT 3 DOT 94 DOT 961111023101 DOT 13027B-100000 AT netdoor DOT com>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019