training

Code I wrote during training
git clone git://git.bitsmanent.org/training
Log | Files | Refs | README

10.6 (841B)


      1 /* Exercise 10.6 */
      2 
      3 struct customer {
      4    char lastName[15];
      5    char firstName[15];
      6    int customerNumber;
      7 
      8    struct {
      9       char phoneNumber[11];
     10       char address[50];
     11       char city[15];
     12       char state[3];
     13       char zipCode[6];
     14    } personal;
     15 
     16 } custmerRecord, *customerPtr;
     17 
     18 customerPtr = &customerRecord;
     19 
     20 
     21 a) customerRecord.lastName;
     22 b) customerPtr->lastName;
     23 c) customerRecor.firstName;
     24 d) customerPtr->firstName;
     25 e) customerRecor.customerNumber;
     26 f) customerPtr->customerNumber;
     27 g) customerRecord.personal.phoneNumber;
     28 h) customerPtr->personal.phoneNumber;
     29 i) customerRecord.personal.address;
     30 j) customerPtr->personal.address;
     31 k) customerRecord.personal.city;
     32 l) customerPtr->personal.city;
     33 m) customerRecord.personal.state;
     34 n) customerPtr->personal.state;
     35 o) customerRecord.personal.zipCode;
     36 p) customerPtr->personal.zipCode;
     37