Pointer Arithmetic

Computer Systems I

Introduction

 

Lab Steps

Part 0 - Setup

  1. In your csc2400 directory, create another directory called pointers.
  2. Copy the file pointers.c from /mnt/a/mdamian/courses/pointers into your directory pointers.

Part 1 - Average

  1. Implement the functions "average" and "print_array". Use pointer arithmetic (no array indexing).

Part 2 - Reverse

  1. Implement the "reverse" function that reverses elements in an array. Use pointer arithmetic (no array indexing).

Part 3 - Length

  1. Implement the "length" function that returns the length of a string (character array) and the "print_string" function that prints out the string.  Use pointer arithmetic (no array indexing).

Part 4 - Compare

  1. Implement the "compare" function that compares two strings for equality.  Use pointer arithmetic (no array indexing).

Part 5 - Copy

  1. Implement the "copy" function that copies one string to another string.  Use pointer arithmetic (no array indexing).

Part 6 - Concatenate

  1. Implement the "concat" function that concatenates two strings.  Use pointer arithmetic (no array indexing).