Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #87431

Re: What is a `**ppEnum`?

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c++
Subject Re: What is a `**ppEnum`?
Date 2022-11-17 13:03 +0000
Organization A noiseless patient Spider
Message-ID <87v8ndu41f.fsf@bsb.me.uk> (permalink)
References (2 earlier) <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>

Show all headers | View raw


T <T@invalid.invalid> writes:

> The only thing I am not following, is how do I know the
> length of each item in the array and how many items are
> in the array.

I typed this up before seeing Mike's reply.  It seems this has been
covered more than once, but since I've typed it already...

Do you understand the concept of using a pointer to "return" a value
from a function?  For example

  int get_some_fancy_hardware_value(long *res);

This interface return success (0) or some negative value indicating an
error so the return value can't be used to get the fancy value out of the
hardware.  Instead, it's placed in the long pointed to by the long *
argument.  You'd write:

  long hw_val;
  if (get_some_fancy_hardware_value(&hw_val) >= 0)
       printf("value=%ld\n", hw_val);
  else fprintf(stderr, "Could not get hardware value.\n");

Sometimes the value you want to get out is itself a pointer.  In these
cases that argument will be a pointer to a pointer, as in your example.

-- 
Ben.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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