Well, the short version is that it's not right.
But we won't always be able to tell you that.
How would you determine if it's right or not? You have to use the function in a series of tests.
input --> expected output.
Does the given input produce the expected output? Start with simple examples to see if they work.
Some specific issues
1.
1 2
|
// if we have a vowel, add '0' before and after decryptedChar
decryptedChar+='0';
|
This change doesn't affect anything, because decryptedChar isn't being used to do anything. It's simply a local char variable that you have declared.
It also isn't doing what you intend, because you're adding to the value of the char itself. A char is not a string. A string is made up of multiple chars.
Here is how you prepend '0' to a string:
1 2
|
string str = "blah";
str = "0" + str;
|
2.
1 2
|
size_t found = VOWELS.find(VOWELS);
if (currentChar = found)
|
= is for assignment, not testing for equality. == tests for equality.
But this is not how string.find is used.
Check out
https://www.geeksforgeeks.org/string-find-in-cpp/ for some examples,
1 2 3 4 5 6 7
|
string str = "geeksforgeeks a computer science";
string str1 = "geeks";
// Find first occurrence of "geeks"
size_t found = str.find(str1);
if (found != string::npos)
cout << "First occurrence is " << found << endl;
|
3.
You return ss.str(), but where do you ever add anything to ss?