Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #43238 > unrolled thread
| Started by | "Bill Cunningham" <nospam@nspam.invalid> |
|---|---|
| First post | 2014-04-21 13:57 -0400 |
| Last post | 2014-04-22 13:12 -0700 |
| Articles | 8 on this page of 28 — 13 participants |
Back to article view | Back to comp.lang.c
pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-21 13:57 -0400
Re: pointers and pointing Barry Schwarz <schwarzb@dqel.com> - 2014-04-21 11:58 -0700
Re: pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-21 15:09 -0400
Re: pointers and pointing buja <buja66@gmail.com> - 2014-04-21 12:44 -0700
Re: pointers and pointing gazelle@shell.xmission.com (Kenny McCormack) - 2014-04-21 20:28 +0000
Re: pointers and pointing "Osmium" <r124c4u102@comcast.net> - 2014-04-21 15:43 -0500
Re: pointers and pointing Ken Brody <kenbrody@spamcop.net> - 2014-04-22 10:28 -0400
Re: pointers and pointing ralph <nt_consulting@yahoo.com> - 2014-04-21 16:25 -0500
Re: pointers and pointing Barry Schwarz <schwarzb@dqel.com> - 2014-04-21 15:14 -0700
Re: pointers and pointing James Kuyper <jameskuyper@verizon.net> - 2014-04-21 18:41 -0400
Re: pointers and pointing gazelle@shell.xmission.com (Kenny McCormack) - 2014-04-21 22:48 +0000
Re: pointers and pointing jacob navia <jacob@spamsink.net> - 2014-04-22 00:22 +0200
Re: pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-21 18:25 -0400
Re: pointers and pointing Barry Schwarz <schwarzb@dqel.com> - 2014-04-21 20:56 -0700
Re: pointers and pointing glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-22 05:51 +0000
Re: pointers and pointing James Kuyper <jameskuyper@verizon.net> - 2014-04-22 07:38 -0400
Re: pointers and pointing David Brown <david.brown@hesbynett.no> - 2014-04-22 09:16 +0200
Re: pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-22 09:37 -0400
Re: pointers and pointing Richard <rgrdev_@gmail.com> - 2014-04-22 15:00 +0100
Re: pointers and pointing Ken Brody <kenbrody@spamcop.net> - 2014-04-22 10:36 -0400
Re: pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-22 14:09 -0400
Re: pointers and pointing Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-04-22 22:40 +0100
Re: pointers and pointing Richard <rgrdev_@gmail.com> - 2014-04-23 00:05 +0100
Re: pointers and pointing Barry Schwarz <schwarzb@dqel.com> - 2014-04-22 16:08 -0700
Re: pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-23 22:19 -0400
Re: pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-22 14:22 -0400
Re: pointers and pointing "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-22 14:24 -0400
Re: pointers and pointing buja <buja66@gmail.com> - 2014-04-22 13:12 -0700
Page 2 of 2 — ← Prev page 1 [2]
| From | "Bill Cunningham" <nospam@nspam.invalid> |
|---|---|
| Date | 2014-04-22 14:09 -0400 |
| Message-ID | <lj6b9d$dn1$1@dont-email.me> |
| In reply to | #43291 |
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
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
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2014-04-22 22:40 +0100 |
| Message-ID | <0.44dd6563fdda57909447.20140422224053BST.87eh0pxct6.fsf@bsb.me.uk> |
| In reply to | #43323 |
"Bill Cunningham" <nospam@nspam.invalid> writes: <snip> > [...] 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. I think you may not be best placed to make such a claim. It could be that they don't explain it well to you, but that is not at all the same thing as not doing well (in general) at 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 > 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. In 2010 you posted code using getaddrinfo() that provided correct arguments for the call. Did you understand what you'd written then? <snip> -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Richard <rgrdev_@gmail.com> |
|---|---|
| Date | 2014-04-23 00:05 +0100 |
| Message-ID | <87ppk9m0ct.fsf@gmail.com> |
| In reply to | #43323 |
"Bill Cunningham" <nospam@nspam.invalid> 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
[toc] | [prev] | [next] | [standalone]
| From | Barry Schwarz <schwarzb@dqel.com> |
|---|---|
| Date | 2014-04-22 16:08 -0700 |
| Message-ID | <rcsdl91ipgks1ohel7auq45n0gju4laitj@4ax.com> |
| In reply to | #43323 |
On Tue, 22 Apr 2014 14:09:54 -0400, "Bill Cunningham" <nospam@nspam.invalid> wrote: >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 Obviously you don't understand. Since *p cannot be a pointer, how can you include in the list of possible arguments that would satisfy a request for a pointer. Since this has been pointed out to you multiple times, why do you keep repeating the same erroneous statements? >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. Since none of the parameters for getaddrinfo have type void*, you are either mixing apples and oranges or engaging in your usual technique of throwing out random C related topics with no regard to their relevance. -- Remove del for email
[toc] | [prev] | [next] | [standalone]
| From | "Bill Cunningham" <nospam@nspam.invalid> |
|---|---|
| Date | 2014-04-23 22:19 -0400 |
| Message-ID | <lj9sbc$ile$1@dont-email.me> |
| In reply to | #43393 |
"Barry Schwarz" <schwarzb@dqel.com> wrote in message
> Since none of the parameters for getaddrinfo have type void*, you are
> either mixing apples and oranges or engaging in your usual technique
> of throwing out random C related topics with no regard to their
> relevance.
Geesh Barry you know what I mean. I was just speaking of two different
examples of two different things. Pull the bur out of your ass. The world's
not coming to an end. It seems you want to do more arguing than anything
else or about C.
[toc] | [prev] | [next] | [standalone]
| From | "Bill Cunningham" <nospam@nspam.invalid> |
|---|---|
| Date | 2014-04-22 14:22 -0400 |
| Message-ID | <lj6c10$j8q$1@dont-email.me> |
| In reply to | #43291 |
Ken Brody wrote:
> 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.)
Oh yes and PS. I thought &p was passing the address of the pointer?
We're using different language about the same thing.
Bill
[toc] | [prev] | [next] | [standalone]
| From | "Bill Cunningham" <nospam@nspam.invalid> |
|---|---|
| Date | 2014-04-22 14:24 -0400 |
| Message-ID | <lj6c51$k7j$1@dont-email.me> |
| In reply to | #43291 |
Ken Brody wrote:
> 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.)
Oh yes and when you say point to the pointer do you mean if a paramter
wants say a void ** ? The wording is beginning to confuse. Sorry.
Bill
[toc] | [prev] | [next] | [standalone]
| From | buja <buja66@gmail.com> |
|---|---|
| Date | 2014-04-22 13:12 -0700 |
| Message-ID | <0380efaa-67fd-47e2-9d91-bfb5cd9af42f@googlegroups.com> |
| In reply to | #43328 |
> Oh yes and when you say point to the pointer do you mean if a paramter > > wants say a void ** ? The wording is beginning to confuse. Sorry. > > Bill The questions you have show a serious lack of understanding of the basics of C. If you don't understand pointers, don't even bother about function parameters, call by value and other "advanced" topics. The best advice I can give you is to buy a book on C, read it, reread it and run the examples. Quite a bit of effort, but the only way you (or anyone else) will ever learn. You cannot expect this group to teach you C question by question. If you don't put in the effort yourself, you will not get much further than 'Hello world!'.
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.c
csiph-web