Arrays & Strings in C

Computer Systems I

Introduction

 

Lab Steps

Part 1 - Average

  1. Download the file arraystrings.c, or view, copy and paste it to a file of the same name, using a text editor of your choice (pico, vi, emacs). The best way to do this is to save arraystrings.c to your laptop and then FTP it to your student account, if using the department's Unix system. You can accomplish this using the file transfer feature of SSH Secure Shell.
  2. Implement the functions "average" and "print_array".

Part 2 - Reverse

  1. Implement the "reverse" function that reverses elements in an array.

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.

Part 4 - Compare

  1. Implement the "compare" function that compares two strings for equality.

Part 5 - Copy

  1. Implement the "copy" function that copies one string to another string.

Part 6 - Concatenate

  1. Implement the "concat" function that concatenates two strings.