type identifier
for value
type & identifier
for reference.
int FixShift(int value) { while(value < 0) { value += 26; } return value % 26; }
int GetShift() { int userShift{0}; int realShift{0}; cout << "Enter the shift amount => "; cin >> userShift; cout << endl; cin.ignore(100,'\n'); realShift = FixShift(userShift); return realShift; }
void FixShift2(int & value) { while(value < 0) { value += 26; } value %= 26; return; }
int GetShift2() { int userShift{0}; cout << "Enter the shift amount => "; cin >> userShift; cout << endl; cin.ignore(100,'\n'); FixShift2(userShift); return userShift; }