1 / 16

4-6 Scope

4-6 Scope. Scope determines the region of the program in which a defined object is visible. Scope pertains to any object that can be declared, such as a variable or a function declaration. Topics discussed in this section:. Global Scope Local Scope.

faaron
Download Presentation

4-6 Scope

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 4-6 Scope Scope determines the region of the program in which a defined object is visible. Scope pertains to any object that can be declared, such as a variable or a function declaration. Topics discussed in this section: Global Scope Local Scope Computer Science: A Structured Programming Approach Using C

  2. FIGURE 4-32 Scope for Global and Block Areas Computer Science: A Structured Programming Approach Using C

  3. Note Variables are in scope from declaration until the end of their block. Computer Science: A Structured Programming Approach Using C

  4. 4-7 Programming Example— Incremental Development Top–down development, a concept inherent to modular programming, allows us to develop programs incrementally. By writing and debugging each function separately, we are able to solve the program in smaller steps, making the whole process easier. Topics discussed in this section: First Increment: main and getData Second Increment: add Final Increment: Print ResultsThe Computer Science: A Structured Programming Approach Using C

  5. FIGURE 4-33 Calculator Program Design Computer Science: A Structured Programming Approach Using C

  6. PROGRAM 4-13 Calculator Program—First Increment Computer Science: A Structured Programming Approach Using C

  7. PROGRAM 4-13 Calculator Program—First Increment Computer Science: A Structured Programming Approach Using C

  8. PROGRAM 4-13 Calculator Program—First Increment Computer Science: A Structured Programming Approach Using C

  9. PROGRAM 4-14 Calculator Program—Second Increment Computer Science: A Structured Programming Approach Using C

  10. PROGRAM 4-14 Calculator Program—Second Increment Computer Science: A Structured Programming Approach Using C

  11. PROGRAM 4-14 Calculator Program—Second Increment Computer Science: A Structured Programming Approach Using C

  12. PROGRAM 4-14 Calculator Program—Second Increment Computer Science: A Structured Programming Approach Using C

  13. PROGRAM 4-15 Calculator Program—Final Increment Computer Science: A Structured Programming Approach Using C

  14. PROGRAM 4-15 Calculator Program—Final Increment Computer Science: A Structured Programming Approach Using C

  15. PROGRAM 4-15 Calculator Program—Final Increment Computer Science: A Structured Programming Approach Using C

  16. PROGRAM 4-15 Calculator Program—Final Increment Computer Science: A Structured Programming Approach Using C

More Related