string input;
int a, b, c;
int index = -1;
char output[255];
a = rand() % 10;
b = rand() % 10;
c = rand() % 9;
cin >> input;
for (char c : input)
{
int numeric = getNumber(c);
numeric += a + b + c;
if (numeric > 26)
{
numeric -= 26;
}
output[index++] = getCharacter(numeric);
}
for (char c : output)
{
cout << c;
}
cout << endl;
I've looked online for some answers, but nothing really helped :(
What can I change and why does this happen?