title: Finding even numbers by using pointers in c++
body: <p>I am doing an assignment about pointers. In one of the question, it asks me to find even numbers in an array and print all of them.
  I also have to use the signature that is given by the assignment and I can not use  use the &amp; operator or [] notation in my function.</p>
  
  <p>Signature: <code>void print_evens(int *nums,int length) ;</code></p>
  
  <p>I know I have to use,</p>
  
  <pre><code>if(i%2==0)
    cout &lt;&lt; i &lt;&lt; endl;
  </code></pre>
  
  <p>to find the even numbers but I don't know how to do it with pointers.</p>
  
  <p>How can I pass an array from main function to the <code>print_evens</code> since there are no parameters for array?</p>
  
  <p>Thank you for any help.</p>