training

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

10.5 (777B)


      1 /* Exercise 10.5 */
      2 
      3 a)
      4    struct inventory {
      5       char partName[30];
      6       int partNumber
      7       int stock
      8       int reorder;
      9       double price;
     10    };
     11 
     12 b)
     13    union data {
     14       char c;
     15       short s;
     16       long b;
     17       float f;
     18       double d;
     19    };
     20 
     21 c)
     22    struct address {
     23       char streetAddress[25];
     24       char city[20];
     25       char state[3];
     26       char zipCode[6];
     27    };
     28 
     29 d)
     30    struct student {
     31       char firstName[15];
     32       char lastName[15];
     33       struct address homeAddress;
     34    };
     35 
     36 e)
     37    struct test {
     38       int a: 1;
     39       int b: 1;
     40       int c: 1;
     41       int d: 1;
     42       int e: 1;
     43       int f: 1;
     44       int g: 1;
     45       int h: 1;
     46       int i: 1;
     47       int j: 1;
     48       int k: 1;
     49       int l: 1;
     50       int m: 1;
     51       int n: 1;
     52       int o: 1;
     53       int p: 1;
     54    };
     55