title: How do i set a function to a constant variable?
body: <p>It's been a while since I have worked in C++, I am helping a friend.</p>
  
  <p>Is there a way without pointers return number of lines to a const int for use in a for loop? </p>
  
  <p>I know I can do it with pointers but he has not learned them in class yet and I am not morally allowed to teach him anything the professor hasn't.</p>
  
  <p>Example:</p>
  
  <pre><code>int numLines = sizeOfFile(inputFile);
  for(int i = 0, i &lt; numLines; i++){
    //code here
  }
  </code></pre>
  
  <p>EDIT: my fault I was moving fast to code this thing. I am helping him today I want to have a finished project so I can work off of it while helping him. The reason I need a constant int is so I can set array to that size not just for a for loop. the array is the problem.</p>