02/27/06 CISC181 Question: My script has all icky characters in it. What can I do? Answer: (1) Be more careful when you type your script. :-) (if you delete or use tab and stuff, all those corrections end up in your script.) (2) Use Dan Roche's "script-fix" program: http://www.udel.edu/CIS/181h/pconrad/06S/ta/script-fix.html Be careful though: editing a script with "intent to deceive", i.e. turning "incorrect" program behavior into "correct" program behavior is considered a serious form of academic dishonesty. So use Dan's script to "clean up" your command lines, but DON'T use vi, emacs or g*d-forbid "pico" to make it look like your program "worked", when in fact it did not. :-) Our next set of topics: (1) Parallel arrays We covered this briefly on 02/24, and decided to move on. If you haven't seen this before, come see me during office hours and I can explain it. Or, visit Matt Rein's excellent review session, and ask him about parallel arrays. (2a) A digression about arrays and pointers. (We need to be comfortable with this beore moving to topics 3 and 4). We'll start with how to write a recursive version of: int printArray(int n, int a[]); There are two ways.. one involving pointers, and another not involving pointers. First let's review the basics of addresses and pointers. Look at the programs address1.cc and address2.cc (2b) Arrays of structs reading a .csv file into an array of structs using strtok That's where we'll start next.... picking up from the lecture of 02/24. See lect/02.27.1.25pm/csvFiles Our data is in workoutData.dat Our program to read the data is readWorkoutData.cc So far this program only reads the file and echoes the contents of the file on the screen. Our next step is to load the data into an array of structs. We'll then step through the array and print out the values from the array. (3) Sorting an array of structs selection sort (4) searching an array of structs (5) Dynamic memory allocation not wasting the space when names are short having enough room when names are long malloc/free in C.... new/delete in C++ (6) Linked Lists of structs (7) function overloading Then, we'll be ready for classes and object oriented programming... [POINT B]