How do you use qsort on a text file of different length records(when you have to sort two things(record type(first character) and customer_code(chars 2-6))) when the data is in structures inside a union?
e.g.:
Code:
  struct i_r_record{
                            char rec_type,
                            cust_code[5],
                             part_num[6],
                              i_r_qty[4];
                            };
  struct c_record{
                           char rec_type,
                           cust_code[5],
                           cust_name[20],
                           cust_address[60],
                           cust_bal[9],
                           cust_limit[7];
                         };
  struct d_record{
                            char rec_type,
                               cust_code[5];
                        };
  union records {
                          struct i_r_records i;
                          struct c_records c;
                          struct d_records d;
                         };
[code][/code]tagged by Salem