title: C++ : Array of struct as function parameter
body: <p>I have a struct: </p>
  
  <pre><code>typedef struct
  {  
     int nNum; 
     string str;   
  }KeyPair;
  </code></pre>
  
  <p>Let's say I initialize my struct: </p>
  
  <pre><code>KeyPair keys[] = 
  {    {0, "tester"},  
       {2, "yadah"},  
       {0, "tester"} 
  };  
  </code></pre>
  
  <p>I want to use the initialized values in a function. <strong>How do I pass this array struct as a function parameter?</strong> </p>
  
  <p>I have: </p>
  
  <pre><code>FetchKeys( KeyPair *pKeys)
  {
       //get the contents of keys[] here...   
  }
  </code></pre>