title: Is it possible to pass a reference of std::array?
body: <p>So I'm trying to write a function that changes the array outside of it, kind of like passing a value to a function as a reference.
  Here's my code:</p>
  
  <pre><code>std::array&lt;Card, 52&gt; deck {};
  std::array&lt;Card, 52&gt; &amp;deckRef = deck;
  
  initializeDeck(deckRef);
  printDeck(deckRef);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>void initializeDeck(std::array&lt;Card, 52&gt; deck){
  int16_t cardNumber{0};
  for(int counterSuit{0}; counterSuit &lt; CardSuit::MAX_SUITS; ++counterSuit)
  {
      for(int counterRank{0}; counterRank &lt; CardRank::MAX_RANKS; ++counterRank)
          {
              Card card { static_cast&lt;CardRank::CardRank&gt;(counterRank),
                          static_cast&lt;CardSuit::CardSuit&gt;(counterSuit)};
  
              deck[cardNumber] = card;
              ++cardNumber;
  
          }
  }}
  
  void printDeck(std::array&lt;Card, 52&gt; deck){
  for(int16_t counter{0}; counter &lt; 52; ++counter)
      {
          printCard(deck[counter]);
      }}
  </code></pre>
  
  <p>printDeck prints garbage however if I add a printCard() to initializeDeck(), it prints all the cards just fine, however it doesn't get stored in the original array in main().</p>
  
  <p>I get this error when I do this;</p>
  
  <pre><code>void initializeDeck(std::array&lt;Card, 52&gt;&amp; deck)
  
  undefined reference to `initializeDeck(std::array&lt;Card, 52u&gt;)'|
  </code></pre>
  
  <p>Thanks in advance!
  Thanks in advance!</p>