title: How to print all values of struct array in C
body: <p>I cant seem to figure out how to set my printf statement to be able to print all elements of struct array that I'm passing to print function. </p>
  
  <p>When I try to compile I get warnings: </p>
  
  <pre><code>format specifies type 'char *' but the argument has type 'char' [-Wformat]
  </code></pre>
  
  <p>I tried casting but still get an error. </p>
  
  <p>When I run the program I just get:</p>
  
  <pre><code>Segmentation fault: 11
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>struct Card {
      char suit;
      char face;
  };
  int main(void)
  {
     ...
     struct Card *hand[HAND_SIZE];
     dealHand(deck, face, suit, hand); //deal the deck
     printHand(hand);
  }
  
   void dealHand(unsigned int wDeck[][FACES], const char *wFace[], const char *wSuit[], struct Card *wHand[])
  {
      unsigned int c = 0;
      for (size_t card = 1; card &lt;= HAND_SIZE; ++card) {
          for (size_t row = 0; row &lt; SUITS; ++row) {
              for (size_t column = 0; column &lt; FACES; ++column) {
                  if (wDeck[row][column] == card){
                      struct Card aCard;
                      aCard.face = wFace[column];
                      aCard.suit = wSuit[row];
                      wHand[0] = &amp;aCard;
                      c = c + 1;
                  }
              }
          }
      }
  }
  void printHand(struct Card *wHand[]) {
      for (unsigned i = 0; i &lt; HAND_SIZE; ++i) {
          printf("%c%c\n", wHand[i]-&gt;face, wHand[i]-&gt;suit);
      }
  }
  </code></pre>
  
  <p>How can I print array of structs? </p>
  
  <p>Edit: I replaced %s with %c but now getting warning:</p>
  
  <pre><code>incompatible pointer to integer conversion assigning to 'char' from 'const char *' [-Wint-conversion]
                      aCard.face = wFace[column];
  </code></pre>
  
  <p>New to pointers and not sure how to go about solving this one.</p>