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

    Today’s lecture will be spent entirely in the computer lab. At the end of lab, submit this worksheet.…

    • 581 Words
    • 3 Pages
    Satisfactory 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
  • Good Essays

    COM 320

    • 1665 Words
    • 7 Pages

    Time management can have negative effects on any new employee in a new company. Carl Robins has only been with this company for about six months but he was given a project with no supervision. I believe that appropriate training should have played a key role when he was hired by human resources to be a recruiter. Carl can analyze what steps were taken in regards to his hiring process and whether he paid attention to what needed to be done to be a recruiter. Carl did achieve the first goal and found fifteen qualified applicants that were needed by the company’s Operations Supervisor, Monica Carrolls. She was ensured that all personnel would be ready for orientation by mid-June in order to complete all mandatory obligations per the company’s hiring process. Follow-up steps were not done in a timely manner and the orientation room was being utilized by another department. The company’s calendar did not list all activities and training schedules needed for all to be aware or what was required per section; though it is not apparent if the company even has a calendar that is accessible by each department leader. Although it is clear to see that none of the said personnel was managing each department, it is safe to assume that someone else should have seen these issues before the scheduled events.…

    • 1665 Words
    • 7 Pages
    Good 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
  • 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
  • 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
  • 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

    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

Related Topics