Re: [C] functions and 2D arrays?

From: Arthur J. O'Dwyer (ajo_at_nospam.andrew.cmu.edu)
Date: 01/09/04


Date: Thu, 8 Jan 2004 19:18:11 -0500 (EST)


On Thu, 8 Jan 2004, Arthur J. O'Dwyer wrote:
>
> typedef int (*foo)[3][3];
>
> tells the compiler -- or you yourself -- to substitute
> 'int (*bar)[3][3]' for every instance of 'foo bar' in the code.
> Roughly speaking, of course. So you would translate
>
> foo myfunc();
> to
> int (*myfunc)()[3][3];

  int (*myfunc())[3][3];

> and
> foo myfunc ( foo );
> to
> int (*myfunc)(int (*)[3][3])[3][3];

  int (*myfunc(int (*)[3][3]))[3][3];

  Yeah... /if/ I practice it enough, I'll get it right...!

-Arthur



Relevant Pages

  • Re: Calling Function Without Parentheses!
    ... > MyFunc() ... Aaaaaaaaaaaah indeed. ... !def bar(): ... !def foo(): ...
    (comp.lang.python)
  • Re: array() VS Array()
    ... FOO is read as a global literal constant, you cannot change this and is ... Not in any language I have used, ... That is not a standard of the language, it is merely a convention adopted by ... If i call it myfunc, MYFUNC, or MyFuCn, i expect to be able to refer to ...
    (comp.lang.php)
  • Re: array() VS Array()
    ... FOO is read as a global literal constant, you cannot change this and is ... (Aside, this is one reason i like how perl differentiates uses with $, ... I declare it as 'myFunc', ... If i call it myfunc, MYFUNC, or MyFuCn, i expect to be able to refer to ...
    (comp.lang.php)
  • Re: Pointer arithmetic
    ... 1/0 simply invokes undefined behavior. ... A conforming implementation must not fail to translate a strictly ... Because foo might ...
    (comp.std.c)
  • How to manipulate elements of a list in a single line of code?
    ... I would like to translate the contents of a list. ... say I've got a list of strings and I want to append "foo" to each ...
    (comp.lang.python)