How to declare pointer to array of structs in C
<p>New to pointers and C and need for my program a pointer for an array of structs and be able to pass this pointer to a function. </p>

<p>What is the correct way to declare a pointer of struct array type and what should be my function parameter that can take such pointer?</p>

<p>This is my attempt:</p>

<pre><code>#define HAND_SIZE 5

struct Card {
    char suit;
    char face;
};

void printHandResults(struct Card *hand[HAND_SIZE]);

int main(void)
{
    struct Card hand[HAND_SIZE];
    struct Card (*handPtr)[HAND_SIZE]; //Correct way to declare?
    handPtr = &amp;hand; 
    ...
    printHandResults(handPtr);

}
void printHandResults(struct Card *hand[HAND_SIZE]) {
...
}
</code></pre>

<p>And this is the warning I get:</p>

<pre><code>warning: incompatible pointer types passing 'struct Card (*)[5]' to parameter of type 'struct Card **' [-Wincompatible-pointer-types]
</code></pre>

<p>I understand the pointers are different types but I cant seem to figure out how to set it correctly.</p>

<p>I'll appreciate if someone can *pointer me in the right direction. </p>