ISO C++ forbids comparison between pointer and integer [-fpermissive] <p><strong>The Code</strong></p> <pre><code>int cycle_length(int i, int j) { int cycleLength = 0; for (int k = i; k &lt;= j; k++) { cout &lt;&lt; algorithm(k) &lt;&lt; endl; if (algorithm(k) &gt; cycle_length) { cycleLength = algorithm(k); } } return cycleLength; } </code></pre> <p><code>ISO C++ forbids comparison between pointer and integer [-fpermissive]</code></p> <p>I got this error in this line <code>if ( algorithm(k) &gt; cycle_length)</code>.</p> <p>How is that, however, the same code works right in the <code>main()</code> ?? and what is this error mean ???</p> <p><strong>Added</strong> algorithm is a function take an integer input and return an integer.</p> <pre><code>int algorithm(int number1) { int counter = 1, number = number1; do { if (number % 2 == 0) { number = number / 2; counter++; } else { number = (3 * number) + 1; counter++; } } while (number != 1); return counter; } </code></pre>