Arrays & Strings
Computer Systems I
- In this lab, you will gain more C
programming experience while developing functions that work with arrays
and character strings.
- Things that will come in handy for
this lab are "man", Googling for
examples and ideas, and asking the TA and instructor for assistance.
Part 1 - Average
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.
the functions "average" and "print_array".
Part 2 - Reverse
- Implement the "reverse"
function that reverses elements in an array.
Part 3 - Length
- 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
- Implement the "compare"
function that compares two strings for equality.
Part 5 - Copy
- Implement the "copy"
function that copies one string to another string.
Part 6 - Concatenate
- Implement the "concat" function that concatenates two strings.