Lab-13
Announcements
We will have a simple 10 minute quiz at the beginning of the lab on Blackboard. Please sign in to your Blackboard account and finish the quiz individually. To access the quiz, go to CS 141 course on Blackboard, and click on Quiz, there you can find quiz 13. To access the quiz, you will need a password, which will be announced by the TA in the lab.
You must work with a single partner, in a group of 2. You must take turns being the “driver” and the “navigator”. (If there are an odd-number of students in the class, your TA will make an adjustment.)
Lab Activity
Lab 13: Drawing Data Structures Pictures
This lab is a paper-and-pencil lab. Draw the pictures for each of the data structures below. Each is worth ½ a point, for a maximum of 3.
1. int numbers[5];
2. char words[3][10];
3. int *pNumbers;
pNumbers = (int *) malloc( sizeof( int) * 5);
4. char *pLetters;
pLetters = (char *) malloc( sizeof( char) * 3);
5. char **pWords;
pWords = (char **) malloc( sizeof( char *) * 3);
for( int i=0; i<3; i++) {
pWords[ i] = (char *) malloc( sizeof( char) * 10);
}
6. struct Student {
char name[ 10];
long UIN;
};
Student class[3];
Student *pStudent = &class[ 2];
Student *pOther = pStudent;