Lab 11

Lab assignment: Understanding C-string functions

We've given you some code with some functions to implement, to solidify your understanding of how string functions work.  If you get it then great, there's extra credit to be earned.  If you don't get it, you really need to understand how to develop algorithms to perform these transformations, even if you don't know how the algorithms work.  Use this opportunity to think about how data is being stored and how you can access it to produce elegant algorithms.  These sorts of questions are introductory interview questions, designed to allow you to demonstrate your thinking process.

Like with the standard library functions, you can assume all of the strings (char *) will be null terminated.  I've given an example with mystrlen, which calculates the length of a string as strlen does, though there are many implementations which do the same thing so use the one you like best.

Notes:

Submission:

1. You should work with a partner for this (and all the remaining) lab(s).  Only one of you need to submit the program to Blackboard, though you should be certain that both of your names be present in a comment at the top of the .c or .cpp source file.

1.5 If you work alone, include just your name in a comment at the top so that I know you worked alone, and not have to guess.

2. You should turn in to Blackboard by the END OF THE LAB (8:50 for the 8-9 lab session, 9:50 for the 9-10 lab session).  I know it's tempting to keep working on it, but other classes come in, and it's not fair to the students who are limited to that particular time span if you go over.  Which isn't to say that you can't work on it later, to check your solution against the one I post for your own understanding.  But what you submit for a grade should be before the next hour begins.

3. If you wish, you may submit your lab by 11 am on Thursday for a 1 point penalty.  If you can't finish up the second point by the end of lab, you can still earn the score by completing all three steps and submitting your code by the day after.