Sample Interactive Session 2 (with deletes)
Note: Debug output in orange
% cat licences
UBT878 1
KGB209 1
TEA311 3
MUK772 1
XYZ333 2
% cc -o hash hash.c license.c
% hash
0: NULL
1: NULL
2: NULL
3: license: UBT878, num: 1, hash(license): 3
4: license: KGB209, num: 1, hash(license): 4
5: license: TEA311, num: 3, hash(license): 4
6: license: MUK772, num: 1, hash(license): 5
7: license: XYZ333, num: 2, hash(license): 3
8: NULL
9: NULL
10: NULL
11: NULL
12: NULL
Enter license number (or "quit" or "delete") ---> delete
Enter license number to delete ---> ABC234
Number: "ABC234" not present, can't delete
1: NULL
2: NULL
3: license: UBT878, num: 1, hash(license): 3
4: license: KGB209, num: 1, hash(license): 4
5: license: TEA311, num: 3, hash(license): 4
6: license: MUK772, num: 1, hash(license): 5
7: license: XYZ333, num: 2, hash(license): 3
8: NULL
9: NULL
10: NULL
11: NULL
12: NULL
Enter license number (or "quit" or "delete") ---> delete
Enter license number to delete ---> TEA311
0: NULL
1: NULL
2: NULL
3: license: UBT878, num: 1, hash(license): 3
4: license: KGB209, num: 1, hash(license): 4
5: DELETED
6: license: MUK772, num: 1, hash(license): 5
7: license: XYZ333, num: 2, hash(license): 3
8: NULL
9: NULL
10: NULL
11: NULL
12: NULL
Enter license number (or "quit" or "delete") ---> XYZ333
The 3rd time for license: XYZ333
0: NULL
1: NULL
2: NULL
3: license: UBT878, num: 1, hash(license): 3
4: license: KGB209, num: 1, hash(license): 4
5: DELETED
6: license: MUK772, num: 1, hash(license): 5
7: license: XYZ333, num: 3, hash(license): 3
8: NULL
9: NULL
10: NULL
11: NULL
12: NULL
Enter license number (or "quit" or "delete") ---> KGB209
The 2nd time for license: KGB209
0: NULL
1: NULL
2: NULL
3: license: UBT878, num: 1, hash(license): 3
4: license: KGB209, num: 2, hash(license): 4
5: DELETED
6: license: MUK772, num: 1, hash(license): 5
7: license: XYZ333, num: 3, hash(license): 3
8: NULL
9: NULL
10: NULL
11: NULL
12: NULL
Enter license number (or "quit" or "delete") ---> delete
Enter license number to delete ---> KGB209
0: NULL
1: NULL
2: NULL
3: license: UBT878, num: 1, hash(license): 3
4: DELETED
5: DELETED
6: license: MUK772, num: 1, hash(license): 5
7: license: XYZ333, num: 3, hash(license): 3
8: NULL
9: NULL
10: NULL
11: NULL
12: NULL
Enter license number (or "quit" or "delete") ---> MUK772
The 2nd time for license: MUK772
0: NULL
1: NULL
2: NULL
3: license: UBT878, num: 1, hash(license): 3
4: DELETED
5: DELETED
6: license: MUK772, num: 2, hash(license): 5
7: license: XYZ333, num: 3, hash(license): 3
8: NULL
9: NULL
10: NULL
11: NULL
12: NULL
Enter license number (or "quit" or "delete") ---> quit
% cat licenses.txt
UBT878 1
MUK772 2
XYZ333 3