glennlopez/Prog-2000

Lab 4: Arrays and Pointers

Closed this issue · 0 comments

Arrays and Pointers
Unit Objectives:
The student will be able to:

  1. Distinguish between integer and character arrays.
  2. Describe how an array of characters differs from a string array.
  3. Describe how both an array and a pointer can be used together.
  4. Distinguish between an address of a variable and a variable.
  5. Use the “address of” and “dereferencing” operators in a program.
  6. Use both array subscripts and pointers, to access array elements.
  7. Use pointer arithmetic to modify pointer values.
  8. Copy the contents of one array to another.
  9. Use the “watch” window to examine variables while debugging.
  10. Describe a program’s operation using pseudo-code.

In this unit student should do the following: 1. Read “C by Example”, chapters 4, 19 (p.324-334), 20 and 21. These chapters discuss arrays and pointers. 2. Read the handout on “Pseudo-code”. 3. Answer the questions relevant for the unit 4 from the assignments package on a separate piece of paper. Some of these questions will be marked in class. 4. Do Lab 4, including questions 8.1 to 8.5. Place your pseudo-code, source code and answers to the questions in your Lab Manual. Show your instructor. 5. Demonstrate your functioning program to your instructor and explain its operation.