1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

bug 433472: Sample code is untidy

This commit is contained in:
Andrew Gvozdev 2014-04-29 11:02:32 -04:00
parent 8047915f17
commit f5f4b5101a
2 changed files with 9 additions and 7 deletions

View file

@ -104,7 +104,7 @@ examining the contents of variables.</p>
<br> <br>
</li> </li>
<li>Click <strong>Run &gt; Resume</strong>. <li>Click <strong>Run &gt; Resume</strong>.
<p>The output in the <span class="typewriter">helloworld.exe</span> application window is: &nbsp;&quot;<span class="typewriter">You just entered m, you need to enter m to exit.</span>&quot; <p>The output in the <span class="typewriter">helloworld.exe</span> application window is: &nbsp;&quot;<span class="typewriter">Thank you. Exiting.</span>&quot;
</p></li> </p></li>
<li>The application terminates and the debug session ends. The <strong>Debug</strong> perspective remains open.</li> <li>The application terminates and the debug session ends. The <strong>Debug</strong> perspective remains open.</li>
</ol> </ol>

View file

@ -46,17 +46,19 @@ bar, displays icons for items such as bookmarks, breakpoints, and compiler erro
using namespace std; using namespace std;
int main () { int main () {
// Say Hello five times // Say HelloWorld five times
for (int index = 0; index &lt; 5; ++index) for (int index = 0; index &lt; 5; ++index)
cout &lt;&lt; <q>HelloWorld!</q> &lt;&lt; endl; cout &lt;&lt; &quot;HelloWorld!&quot; &lt;&lt; endl;
char input = 'i'; char input = 'i';
cout &lt;&lt; <q>To exit, press 'm'</q> &lt;&lt; endl; cout &lt;&lt; &quot;To exit, press 'm' then the 'Enter' key.&quot; &lt;&lt; endl;
while(input != 'm') { cin >> input;
while(input != 'm') {
cout &lt;&lt; &quot;You just entered '&quot; &lt;&lt; input &lt;&lt; &quot;'. &quot;
&lt;&lt; &quot;You need to enter 'm' to exit.&quot; &lt;&lt; endl;
cin >> input; cin >> input;
cout &lt;&lt; <q>You just entered </q> &lt;&lt; input
&lt;&lt; <q> you need to enter m to exit.</q> &lt;&lt; endl;
} }
exit(0); cout << "Thank you. Exiting." << endl;
return 0;
} }
</pre> </pre>
</li> </li>