User Tools

Site Tools


guides:programstyle:constants

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guides:programstyle:constants [2020/07/24 12:08] wikiadminguides:programstyle:constants [2024/07/25 15:01] (current) – external edit 127.0.0.1
Line 61: Line 61:
 </code> </code>
  
-Unless otherwise instructed, single prompt, the +Unless otherwise instructed, single use constants are usually not named unless they provide clarity to the program.  Examples include a prompt used one time or an arbitrary field width. 
 + 
 +The following is probably not necessairy 
 +<code c++> 
 +const int FIRST_FIELD_WITDTH = 20; 
 +const string FIRST_PROMPT = "Enter your Age"; 
 +... 
 + 
 +cout << setw(FIRST_FIELD_WIDTH) << FIRST_PROMPT << endl; 
 +</code>
guides/programstyle/constants.1595592522.txt.gz · Last modified: 2024/07/25 15:01 (external edit)