Write the prototype for a function that takes an array of exactly 16 integers

后端 未结 5 1941
悲&欢浪女
悲&欢浪女 2020-12-30 00:44

One of the interview questions asked me to \"write the prototype for a C function that takes an array of exactly 16 integers\" and I was wondering what it could be? Maybe a

5条回答
  •  [愿得一人]
    2020-12-30 00:52

    I think the simplest way to be typesafe would be to declare a struct that holds the array, and pass that:

    struct Array16 {
      int elt[16];
    };
    
    
    void Foo(struct Array16* matrix);
    

提交回复
热议问题