The C++ code is a encryption algorithm, made by Ahmed Qureshi. In the code, it will ask you for a message/string input, then you can press 1 or 2, 1 for encrypting, 2 for decrypting.
When you encrpyt the message, it will encrypt the string, for example, if you type "Hello", the algorithm will encrypt the data/string, and turn it into Jgnnq.
As you have the encrypted message, which from "Hello", it turned into "Jgnnq", you can press 2, to decrypt the encrypted message, then it will turn the string to "Hello".