title: "Access violation" error when running C++ program
body: <p>I keep getting an error of:</p>
  
  <blockquote>
    <p>Unhandled exception at 0x5a6fca58
    (msvcr100d.dll) in Gofish.exe:
    0xC0000005: Access violation writing
    location 0x0ff3b113.</p>
  </blockquote>
  
  <p>The code that I'm trying to run is:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include&lt;Array&gt;
  using namespace std;
  
  class Card{
   string suit;
   int rank;
  public:
   Card(int a, string b){
    rank=a;
    suit=b;
   }
   Card(){}
   string getSuit(){
    return suit;
   }
   int getRank(){
    return rank;
   }
  };
  
  class Deck{
   Card deck [52];
  public:
   Deck(){
    for(int i=1; i&lt;=13; i++){
    deck [i]=Card(i, "spades");
    deck [i*2]=Card(i, "hearts");
    deck [i*3]=Card(i, "diamonds");
    deck [i*4]=Card(i, "clubs");
    }
   }
    void list(){
    for(int i=1; i&lt;=52; i++){
     cout &lt;&lt; deck [i].getRank() &lt;&lt; " of " &lt;&lt; deck [i].getSuit() &lt;&lt; endl;
     }
    }
  };
  
  int main(){
   Deck deck=Deck();
   deck.list();
   system("pause");
   return 0;
  }
  </code></pre>
  
  <p>The compiler I'm using is Microsoft Visual C++ 2010 Express if that might effect anything.</p>