C++ declarations (arrays and pointers)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joeschmoe98

    C++ declarations (arrays and pointers)

    i know that:

    double *a[n]; is an array of n pointers

    double (*b)[n]; is pointer to array of size n

    but what is:

    double ( *c[n] )( ); and

    double ( *d( ) )[n];
  • Sam

    #2
    Re: C++ declarations (arrays and pointers)

    joeschmoe98 writes:
    i know that:
    >
    double *a[n]; is an array of n pointers
    >
    double (*b)[n]; is pointer to array of size n
    >
    but what is:
    >
    double ( *c[n] )( ); and
    >
    double ( *d( ) )[n];
    That looks like a question on your homework, which you should try to figure
    out on your own.


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.7 (GNU/Linux)

    iD8DBQBHuNEkx9p 3GYHlUOIRAsAsAJ 9ijcP7HHrgahC5O id7g45cd8goNgCf eRjs
    h3x2UO4FNyCBftd dxPeTttE=
    =Ei5k
    -----END PGP SIGNATURE-----

    Comment

    • joeschmoe98

      #3
      Re: C++ declarations (arrays and pointers)

      i just dont understand what the empty set of parenthesis are for

      Comment

      • Jeff Schwab

        #4
        Re: C++ declarations (arrays and pointers)

        joeschmoe98 wrote:
        i just dont understand what the empty set of parenthesis are for
        Please don't snip relevant context.

        Empty parentheses in a declaration mean that the thing to their left is
        a function.

        Comment

        • joeschmoe98

          #5
          Re: C++ declarations (arrays and pointers)

          still confused, at least point me in the right direction. please

          Comment

          • Jeff Schwab

            #6
            Re: C++ declarations (arrays and pointers)

            joeschmoe98 wrote:
            still confused, at least point me in the right direction. please
            When you post something new to a thread, please do not remove the
            existing conversation. If re-post your question, please include your
            best guess at what the confusing expressions mean.

            Comment

            • Mike Wahler

              #7
              Re: C++ declarations (arrays and pointers)


              "joeschmoe9 8" <joeschmoe9876@ gmail.comwrote in message
              news:0e3b22c7-b4dd-4b04-9398-5933d293e16c@n5 8g2000hsf.googl egroups.com...
              >i know that:
              >
              double *a[n]; is an array of n pointers
              >
              double (*b)[n]; is pointer to array of size n
              >
              but what is:
              >
              double ( *c[n] )( ); and
              >
              double ( *d( ) )[n];


              -Mike


              Comment

              Working...