[Skip Navigation] [CSUSB] / [CNS] / [CSE] / [R J Botting] /[CS320 Course Materials] [Text Version] lab/06.html Wed Apr 20 20:17:56 PDT 2011
Labs: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]


    CSci320 Programing Languages Laboratory 6 Scoping

    Here are some programs [ tooSimple.cpp ] [ simple.cpp ] [ simple2.cpp ] [ simpleScopes.cpp ] [ scopes.cpp ]

    Download each, compile it, run it, and explore what it tells you about the scope of declarations in C++.

    Any surprises?

    What does it tell you about the way C++ handles scopes. Can you work out the rules for when a variable has a particular meaning? What is dynamically scoped and what is statically scoped.?

    To answer the questions you might need to make some experimental changes.

    Deliverable: you should prepare a new page for your growing WWW site that has two or three paragraphs explaining what you have learned about C++ scoping. It should include a link to the source code for the final versions of some of the programs. Graphics are not needed. The whole page should be linked to the growing list of laboratory pages on your index/home page.

    Deadline: I will be assigning grades at the end of the lab depending on how much of the deliverables are complete and correct. I will checking that your paragraphs have no gross grammar/spelling mistakes as well as that they say something true and interesting about C++ scoping.

    Check the next class

    [ ../07.html ]

    Project Phase 1 Due Next