So I’ve figured out 99% of the code for the substitution problem. My plaintext input is being output correctly, with the correct enciphered letters and the correct case.
However, I keep getting extra chars after the output. See photo for an example.
Any ideas as to why this is happening and how to fix it, aka to only output the enciphered version of the plaintext input?
Does this have something to do with the NUL character stored at the end of the input string? If so, how would I avoid outputting that?
UPDATE: I am trying to figure out how / where to insert the \0 in order to end the array after the encoded letters have been stored. I'll attach photos below.
How should I change this, so that I don't keep getting segmentation fault errors but also don't keep outputting too many chars?