The file that I have has the following format of the customers :-
Customer file format:
<id>,<surname>,<firstname>,<address>,<suburb>,<pos tcode>,
<phone>
Example:
C0001,Bloggs,Joe,123 Long Street,Melbourne,3000,93005555
I could display them in the same format but I want to display them as follewing:-
Example:
ID Surname FirstName Address Suburb Post Phone
----- ------------ -------- -------------------- ------------ ---- -------- C0001 Bloggs Joe 123 Long Street Melbourne 3000 93005555
... ... ... ... ... ... ...
I have written some of the structures for this:
I would really appreciate anyone who helps me with this one.Code:/* Constants for customer information. */ #define CUSTID_LEN 5 #define SURNAME_MAX 12 #define FIRSTNAME_MAX 12 #define ADDRESS_MAX 20 #define SUBURB_MAX 12 #define POSTCODE_LEN 4 #define PHONENUM_LEN 8 typedef struct customerNode* CustomerNodePtr; typedef struct stockNode* StockNodePtr; /* Structure definitions. */ typedef struct customerNode { char custID[CUSTID_LEN + 1]; char surname[SURNAME_MAX + 1]; char firstName[FIRSTNAME_MAX + 1]; char address[ADDRESS_MAX + 1]; char suburb[SUBURB_MAX + 1]; unsigned postCode; unsigned phoneNum; CustomerNodePtr nextCust; } CustomerNodeType;
Thanks