CS 1440 pre-lab activities for Lab 11

1. What is the difference between the following three initialization procedures:

char c[ ] = {"Do Be Do"};
char c[10 ] = {'D', 'o', ' ', 'B', 'e', ' ', 'D', 'o'};
char c[ ] = {'D', 'o', ' ', 'B', 'e', ' ', 'D', 'o'};
 
 
 
 
 

2. Looking at the following struct definition, what can we do to simplify the struct, and make it more powerful?

struct student
{
      string name;
      float grade1;
      float grade2;
      float grade3;
      float grade4;
};
 
 
 
 
 

3. Suppose a data set is given in 3 rows and 2 columns as shown below.  How will you use an array to store these numbers.  Now, how would you go to change the numbers that are negative to positive.  Explain.
 
 

20 -10
23 46
-2 6

4. Suppose two arrays of strings are declared in your main function as:
char word1[20];
char word2[20];

Also, assume that a user has entered two words from the keyboard and has stored them into these two arrays.  Explain how would you go to find whether these two words are the same or different.