Preview

Comp 220

Good Essays
Open Document
Open Document
1463 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Comp 220
| | iLab 5 of 7: Pointers and Pointer OperationsILAB OVERVIEW | | | |

Scenario and Summary | |
This lab will explore the use of pointers in several ways. Pointers will be used to dynamically allocate memory for new class objects on demand from the user, and they will be used to access class-member functions. Pointer arithmetic will be used to access and sort class objects according to criteria explained in the lab.
Pointers are, essentially, address variables, or variables that hold as their value the address of other variables. In terms of memory management, they are very powerful devices, and they more closely and efficiently use the actual internal hardware registers of the microprocessor that the program operates on.
Pointers also have the requirement that the pointer type must be of the same data type as the variable, or the data that it points to or holds the address of. The power of pointers also hints at the potential complexity of their use, which is why this lab is focused almost entirely on several different aspects and uses of pointers. The lab also introduces pointer arrays and pointers to pointers.
The Resistor class created in the Week 2 lab will be used as the class that the pointer operations will be used upon. The lab also requires the use of accessor functions and static data members, which may need to be added to the Resistor class definition and implementation. Deliverables | 1. Submit a single Notepad file containing the source code for all the files of the lab to the Dropbox for Week 5. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab5.txt.

Each program should include a comment section that includes, at a minimum, your name, the lab and exercise number, and a description of what the program accomplishes. 2. Submit a lab report (a Word document) containing the following information to the

You May Also Find These Documents Helpful

  • Good Essays

    comm 320

    • 3670 Words
    • 15 Pages

    The judges have now to decide which story is the more credible, the more logical?…

    • 3670 Words
    • 15 Pages
    Good Essays
  • Good Essays

    Some OS routines directly support application programs as they run and thus must be resident. Other transient routines are stored on disk and read into memory only when needed. Fixed-length partitions can also be used to allocate the set amount of memory that a particular program needs to run. Under dynamic memory management, the transient area is treated as a pool of unstructured free space. When the system decides to load a particular program, a region of memory just sufficient to hold the program is allocated from the pool. Using segmentation, programs are divided into independently addressed segments and stored in noncontiguous memory. Paging breaks a program into fixed-length pages.…

    • 7085 Words
    • 29 Pages
    Good Essays
  • Good Essays

    Arrays store items that have the same type of data type like a group of employees’ names and social security numbers for a team of 2000 personal. Pointer is a variable that greatly extends the power and flexibility of a program, each memory location that is used to store data value has an address. The address provides the means for a PC hardware to reference a particular data item.…

    • 485 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Pt1420 Unit 1 Assignment 2

    • 1305 Words
    • 6 Pages

    Das, D., Gregersen, E., Hosch, L., Lotha, G., Sampaolo, M., Sinha, S. (2014). C++. In Encyclopedia Britannica.…

    • 1305 Words
    • 6 Pages
    Powerful Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    C++ programming: editing, compiling, user I/O, variables (ints, doubles, char, strings, booleans), loops, decisions, functions, pointers, arrays, tables, databases, sorting.…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    Submit your assignment to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this Tutorial icon Dropbox Tutorial.…

    • 432 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    In this lab you will be writing a dynamic storage allocator for C programs, i.e., your own version of the malloc, free and realloc routines. You are encouraged to explore the design space creatively and implement an allocator that is correct, efficient and fast.…

    • 2325 Words
    • 10 Pages
    Powerful Essays
  • Satisfactory Essays

    It 218 Week 4 Checkpoint

    • 290 Words
    • 2 Pages

    A pointer can be defined as a memory address. To further explain this definition, we declared a variable of (name). It will look much like this (int name). Every variable will occupy some memory. Now we will declare another variable to under (int name). This variable will be (int name-1), and now this variable is declared as a pointer to (int name).What makes it a pointer is the fact that (name-1) points towards (int name) in a memory storage sense. Basically the pointer to (int name) is the contents of (int name-1). In simple terms, the pointer is not a variable at all. It is the place a specific variable will store and access its information.…

    • 290 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    References: Bhave, M.P. & Patekar, S.A. (2007). Object-Oriented Programming With C++. Delhi, India: Dorling Kindersley.…

    • 372 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Chapter 3: Understanding Data Types ..........................................................53 Chapter 4: Understanding C# Statements ....................................................75 Chapter 5: Understanding Reference Data Types ..........................................99 Chapter 6: Making Decisions in Code .........................................................135 Chapter 7: Statement Repetition Using Loops ............................................153 Chapter 8: Arrays ......................................................................................175…

    • 109499 Words
    • 438 Pages
    Powerful Essays
  • Powerful Essays

    Linked List

    • 3270 Words
    • 14 Pages

    – Successive elements are connected by pointers. – Last element points to NULL. – It can grow or shrink in size during execution of a program. – It can be made just as long as required. – It does not waste memory space. A…

    • 3270 Words
    • 14 Pages
    Powerful Essays
  • Good Essays

    A basic requirement of memory management is relocation. The main memory is shared among a number of processes in a multiprogramming system. The programmer does not know in advance which programs will be taking up main memory when the program is executed. Because of this, there is a need to relocate the process to a different area of memory.…

    • 435 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Cit Notes for Reference

    • 28196 Words
    • 113 Pages

    Data are entered in to the computer system by means of an input device. The keyboard is one of the most commonly used input device. Other common one included are MICR, OCR, OMR, Digitizer, Joystick, trackball, light pen, mouse etc. There are also unusual input devices that respond to voice and touch. On touch sensitive screens, the user simply touches the location on the screen, where the description of the desired operation is displayed. The computer senses where the screen has been touched and performs the indicated operation.…

    • 28196 Words
    • 113 Pages
    Good Essays
  • Good Essays

    History of C++

    • 813 Words
    • 4 Pages

    Duffy, T. (1999, September 13). C++ success story. Computerworld Vol. 33 Issue 37, p98, 1/3p, 1c. Retrieved December 11, 2006, from Ebsohost.…

    • 813 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    10) When a function is declared _________ the compiler replaces the function call with the respective function code.…

    • 694 Words
    • 3 Pages
    Satisfactory Essays

Related Topics