Matlab any function in C / C++
I would suggest having the 2D implementation call the 1D implementation, rather than duplicating the "any" logic in both implementations, e.g.

bool any(bool** array, const int nRow, const int nCol){
    // mimics the behavior of Matlab's any() function. Returns true if any element of the array is true
    bool val = false;

    for (int i = 0; i &lt; nRow &amp;&amp; val == false; ++i)
    {
        val = any(array[i], nCol); // call 1D version of any
    )
    return val;
}