Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #87423
| Path | csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: What is a `**ppEnum`? |
| Date | Wed, 16 Nov 2022 18:40:51 -0800 |
| Organization | None to speak of |
| Lines | 44 |
| Message-ID | <87v8nemhfw.fsf@nosuchdomain.example.com> (permalink) |
| References | <tksuro$1nh25$1@dont-email.me> <cc3b22c7-20a3-403b-9e87-bdd6d75d46e1n@googlegroups.com> <tkt2u9$1no3l$2@dont-email.me> <ff8b48f4-e2f9-4ae9-865d-7e657f4ac1c0n@googlegroups.com> <tkt73c$1o60i$2@dont-email.me> <tl2bj1$1en4$1@gioia.aioe.org> <tl3t9g$2f98u$1@dont-email.me> <ZcKdnWa04MvjEej-nZ2dnZfqnPadnZ2d@brightview.co.uk> <tl44mh$2fqlq$1@dont-email.me> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | reader01.eternal-september.org; posting-host="bb8b7969f2cb7f9b9861eb04b7ed4835"; logging-data="2618350"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TC9HxtsrJhsUux+zaa0Eo" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
| Cancel-Lock | sha1:nNqXB7k/zul79EYZd9xx0aadasI= sha1:lBuXagr8UGr79rYJS/GOmHj2UWY= |
| Xref | csiph.com comp.lang.c++:87423 |
Show key headers only | View raw
T <T@invalid.invalid> writes:
> On 11/16/22 17:21, Mike Terry wrote:
>> C++
>> HRESULT QueryVolumes(
>> [out] IEnumVdsObject **ppEnum
>> );
>
> My (mis) understanding is that **ppEnum points to a
> pointer that points to an array of HRESULT, which is
> a 32 bit word. Seems I don't understand.
>
> I am expecting the result to give me a long table
> of volumes. Again, I think I misunderstand.
A (valid non-null) pointer value of type `foo*` always points to a
single object of type `foo`. (Handwave: Ignore for now the fact that a
valid pointer can point just past the end of an array object.)
That single object may or may not be an element of an array of `foo`.
If it's just a single object, it can be treated as the lone element of a
single-element array.
In the example above, ppEnum *might* be intended to be used to
manipulate an array of pointers. The declaration isn't enough to tell
us that.
Given a pointer value that points to an element of an array object, you
can access the other elements of that array object by performing pointer
arithmetic on the pointer value. (The [] operator is syntactic sugar
for this; x[y] means *(x+y).) In C, most array manipulation is done via
pointers to the elements of the array.
It's less common to have to deal with this in C++ than in C, since C++
defines container classes like std::vector that hide the raw pointer
operations. But C++ still inherits just about all of C's (often
counterintuitive) pointer and array semantics.
Recommended reading:
Section 6 of the comp.lang.c FAQ <https://www.c-faq.com/>.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 00:39 -0800
Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 01:29 -0800
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 01:46 -0800
Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 01:52 -0800
Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 01:55 -0800
Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 02:30 -0800
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 02:38 -0800
Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 02:48 -0800
Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 01:39 -0800
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 01:48 -0800
Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 02:01 -0800
Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 02:33 -0800
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 02:59 -0800
Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 03:33 -0800
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 11:10 -0800
Re: What is a `**ppEnum`? Juha Nieminen <nospam@thanks.invalid> - 2022-11-16 09:47 +0000
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-16 15:55 -0800
Re: What is a `**ppEnum`? scott@slp53.sl.home (Scott Lurndal) - 2022-11-17 00:19 +0000
Re: What is a `**ppEnum`? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-11-17 01:21 +0000
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-16 18:01 -0800
Re: What is a `**ppEnum`? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-11-16 18:40 -0800
Re: What is a `**ppEnum`? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-11-17 04:18 +0000
Re: What is a `**ppEnum`? Juha Nieminen <nospam@thanks.invalid> - 2022-11-17 08:25 +0000
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-17 00:31 -0800
Re: What is a `**ppEnum`? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-11-17 10:17 -0800
Re: What is a `**ppEnum`? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-11-17 13:03 +0000
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-17 10:28 -0800
Re: What is a `**ppEnum`? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-11-17 03:36 +0000
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-16 20:57 -0800
Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-14 14:34 +0100
Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-14 14:44 +0100
Re: What is a `**ppEnum`? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-11-14 09:12 -0800
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 11:02 -0800
Re: What is a `**ppEnum`? Ralf Fassel <ralfixx@gmx.de> - 2022-11-15 10:17 +0100
Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-15 04:24 -0800
Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-15 14:04 +0100
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-15 08:28 -0800
Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-17 16:21 +0100
Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-17 16:39 -0800
Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-19 14:16 +0100
csiph-web