Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!mit.eternal-september.org!.POSTED!not-for-mail From: Richard Newsgroups: comp.lang.c Subject: Re: pointers and pointing Date: Wed, 23 Apr 2014 00:05:22 +0100 Organization: http://www.ieee.org/ Lines: 39 Message-ID: <87ppk9m0ct.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mit.eternal-september.org; posting-host="bdee7d74bb5599725cdba9fe2a37525e"; logging-data="12462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uXtRGOFxeokmSK/a3CoWpGu9En7qjzQk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:c+AHOb7KMzAzWcsOUIIJT3UuUBE= sha1:luuCZFPAIzhJ9LJ8QPHWmtegzrE= Xref: csiph.com comp.lang.c:43392 "Bill Cunningham" writes: > Ken Brody wrote: >> On 4/22/2014 9:37 AM, Bill Cunningham wrote: >> [...] >>> int *p; >>> >>> Ok when do I use p and when do I use *p. That right now I am working >>> on. >> >> If "p" is a pointer, you use "p" when you want the pointer, and "*p" >> when you want what it points to. (And you use "&p" when you want to >> point to the pointer.) > > I understood that much. But I think some of the problem with this here > is documentation for certain functions. Docs don't always do well in > explaining what a function wants. Seeing a parameter wants a generic pointer > can mean it wants p or *p or &p. Just depending on the function of the What functions want a "*p" Bill? LOL. 0/10 > function. And with a parameter that says void * makes things even worse > because it is written to take any type. I am speaking of getaddrinfo() in > particularly. It deals with struct addrinfo type. > > WIth this one mentioned above, you better understand what this function > is all about. > > Bill > -- "Avoid hyperbole at all costs, its the most destructive argument on the planet" - Mark McIntyre in comp.lang.c