Regarding your first problem, your cipher
and text
variables share the same location in memory because you're passing a pointer when you call your encipher function. This means your islower()
check in line 70 will never executereturn true.
Also please comment your code when you want others to read it. It's pretty tough to know what's going on without going through every detail.