Calling a function from inside a function while they both are at a header file : <p>I hope i am not recycling already asked questions. I searched, i didn't find anything.<br/><br/>
I have a main function in a .cpp file. I also have a header file full with other functions i made. All the functions work great either inside the .cpp file or the header file. However, i made two new functions, the func1 and the func2. Func1 calls func2. They both work when they are inside the .cpp file, but as soon as i move them to the header file, they don't work.
There is an error at the exact point where func1 calls func2.<br/>
The error message is: "func2: identifier not found".<br/>
Now, i assume that for some reason, func1 doesn't identify func2, or it can't 'see' it. <br/>
What do i do wrong? How can i call function inside functions when they are both inside a header file? <br/><br/>
I will include all the necessary code, including func1 and func2.<br/><br/></p>

<p>func1 is something like this (for the whole code, please contact me or visit my github page):
<br/></p>

<pre><code>int func1(int* mat, int n)
{
    ....code.......
    ....code.......
    for (int k = 0; k &lt; n - 1; k++)
    {
        for (int p = k + 1; p &lt; n; p++)
        {
            if (func2(abs(k - p), mat, n)) count++; //i call func2
        }
    }
     .....code......
     .....code......
}
</code></pre>

<p>func2 is just code. nothing interesting. The error occurs when trying  to call it through func1.<br/>
Okay, so as is said, the code works fine when the two functions are in the .cpp file. When they are in the header file, there is an error at this line: <br/></p>

<pre><code>if (func2(abs(k - p), mat, n)) count++; //i call func2
</code></pre>

<p><br/> If you have any questions, please contact me. <br/>
You can find the full code for my program, here: <br/>
<a href="https://github.com/tasospan/Jolly-Jumper" rel="nofollow noreferrer">enter link description here</a></p>
