Sup guys. First year c++ here. Still learning and ive taken it upon myself to go through old daily programmer assignments to see if i can understand and modify them with what ive learned.
The encryption code here reads through your input and whenever it comes to a consonant (vowels are exempt) it double it and puts a 'o' between them. For example: input = Boat would output Bob-o-a-tot (without the dashes). I see how things work but now im having trouble seeing how to reverse the effect to create a decryption, using c++. Any help would be amazing!
So im trying to delete the two letters that follow a consonant.
I could hug you. Thank you so much! now i can continue working on my project. Hopefully i can finish this weekend. It should be a fun encryption project
The program works on the principle of deleting an element from a data structure (such as std::string) at a specified position, applied twice here for the 'o' and the consonant's repeat.
So when we've found a consonant (line 18 in my program) we copy the elements of the array towards the left once (22), removing the 'o', decrement the size of the array (24), copy the elements towards left once more (27), removing that consonant's repeat, and again decrement (29)
Btw, you can remove the #include<map> from the program, it has stayed back from an interim approach