valid code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stumpedatwork@gmail.com

    valid code

    is this valid int (*f)(int (*[*])[]) c?
  • Jens Thoms Toerring

    #2
    Re: valid code

    stumpedatwork@g mail.com wrote:
    is this valid int (*f)(int (*[*])[]) c?
    Not as it is;-) First a question: is the 'c' at the end a
    typo or is it supposed to be part of that? If not a de-
    finintion of a variable 'f' as

    int (*f)(int (*[])[]);

    is valid. It defines 'f' to be a pointer to a function re-
    turning int and taking as its only argument an array of
    pointers to arrays of int.

    If you have a closer look you will notice that I removed
    one '*' from your mix, the one between '[' and ']' in
    the argument. As far as I understand the C99 language it
    stands for a variable length array. If that is correct
    putting back in the '*' should be ok if you have a C99
    compliant compiler since it would just change the mea-
    ning of the argument part from "an array of pointers to
    arrays of int" to "a variable length array of pointers
    to arrays of int".
    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \______________ ____________ http://toerring.de

    Comment

    • stumpedatwork@gmail.com

      #3
      Re: valid code

      Thank you Jens. It was a typo. :-)

      It was the c99 vla thart puzzled me.

      Comment

      Working...