I have a question regarding reading a txt file and then putting the info in a link list. the problem is that the file contains 3 things to read a letter, a username and a password in the below format:
A Hanna hdfjuju
first i must read a letter then depending on the letter i must do something.
for example if i read the letter A i must then read the next 2 words and add each to the link list. then i read the next line and so on.
here are the letters and what they do:
S: means to start a file named P2-output1.txt and if its already there to add to it
A: to add the username and password following the letter
V: to save from link list to the output file
P: to print
E: to exit
i only need to know the correct logic. what exactly should i do?
i know how to add to link list but i dont know how to read the first letter then continue reading after it and doing what the letter should do.
attached is the input file.