I need to a line of input from a file, echoprint the original line, decrypt it using a substitution cipher, then output the decoded line. So it would be like this:
original line 1
decoded line 1
original line 2
decoded line 2
original line 3
decoded line 3
etc...
The maximum characters per line is 70, so I'm trying to count each character on a line, then use a subarray to put that line into an array so I can then decode it.
I am stuck at putting just one line into an array. I could put the whole line into one, but I have no idea how to just use one line at a time. Any tips?
line 5: Why are you incrementing the character just read?
Lines 2-6: You not storing the characters you have read anywhere.
Line 10: Your termination condition in the for loop is comparing count to the last character read by the do/while loop, which will always be a newline character.
Line 12: There is no need to keep an array of lines. You only need to process one line at a time.