Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ free function
    text
    copied!<p>I have the following code</p> <pre><code>#include "stdafx.h" #include &lt;iostream&gt; using namespace std; #include "graderec.h" int main( ) { GradeRecord studentAnn("45-2791", 14, 49); GradeRecord studentBob("67-5803",25, 50); int bobsUnits; int bobsGradePoints; int annsUnits = 4; int annsGradePoints = 16; cout &lt;&lt; "Ann's Grade Information:" &lt;&lt; endl; studentAnn.writeGradeInfo(); cout &lt;&lt; endl; cout &lt;&lt; "Bob's Grade Information:" &lt;&lt; endl; studentBob.writeGradeInfo(); cout &lt;&lt; endl; cout &lt;&lt; "Enter Bob's units: "; cin &gt;&gt; bobsUnits; cout &lt;&lt; "Enter Bob's grade points: "; cin &gt;&gt; bobsGradePoints; cout &lt;&lt; endl; cout &lt;&lt; "Bob's Grade Information:" &lt;&lt; endl; studentBob.updateGradeInfo(bobsUnits, bobsGradePoints); studentBob.writeGradeInfo(); cout &lt;&lt; endl; cout &lt;&lt; "Ann's Grade Information:" &lt;&lt; endl; studentAnn.updateGradeInfo(annsUnits, annsGradePoints); studentAnn.writeGradeInfo(); system("PAUSE"); return 0; } void asterisks() { cout &lt;&lt; "************************************************************************" &lt;&lt; endl; } </code></pre> <p>I need to use a free function to display about 60 asterisks where I have cout &lt;&lt; endl. I followed the example that I was giving but can't get it to work. </p> <p>The code below is the example that I was given on how a free function looks.</p> <pre><code>void companyBanner() { cout &lt;&lt; *************************** &lt;&lt; endl; cout &lt;&lt; ** Tech Guys LLC ** &lt;&lt; endl; cout &lt;&lt; *************************** &lt;&lt; endl; cout &lt;&lt; endl; } </code></pre> <p>Updatea: Got it working, thanks for the help everyone. I rewrote the free function and added asterisks() above the main again and it worked. Must have been something in the free function that was causing it to not work.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload