 <p>You must declare printTop() above the main method. C++ compilers expect methods to be forward declared (<a href="https://en.wikipedia.org/wiki/Forward_declaration" rel="nofollow">https://en.wikipedia.org/wiki/Forward_declaration</a>).</p>