This is a fairly simple program that basically reads in a phrase from the user, then a number. The number is used to encrypt the data. For every character read in it adds 1 to it, then the second number it adds 2 to, then third 3 and so on until the number that was entered by the user is reached, so lets say the user entered 3, the it would add 1, then 2, then 3 then start over so to the fourth it would add 1 again. EX: # = 3, input: "This", output: "Ujlt". It does this until the phrase has been entered fully, but to add to this no output is needed. I need help with getting the function to work, it's confusing me how to start it over when then number is reached. This is what I have so far so let me know what you think
do
{
if (count <= num)
{
ch = cin.get();
ch + count = ch;
count++;
}
else
{
count = 1;
ch = cin.get();
ch + count = ch;
count++;
}
}while ( ch[0] != ‘#’);