Can you make a small, complete program that compiles, executes and shows the problem for testing?
Put all the data in file so the program does not require a database.