I suspect that the if-else tree can be simplified a bit using isalphaisalpha
and family, but this is what I might implement your algorithm like;
I suspect that the if-else tree can be simplified a bit using isalpha and family, but this is what I might implement your algorithm like;
I suspect that the if-else tree can be simplified a bit using isalpha
and family, but this is what I might implement your algorithm like;
It's fine in short programs like this, but as you hinted that you're fairly new to C++, I wanted to mention that this can be a bad habit to get into. In particular, in large applications with many different segments of code, this can cause naming clashes.
I would probably call rot
, rot13
since there are other kinds of rotations. This is mainly me just being overly picky though :).
If this is not a bug, you should know that that this this will be always be true if input[index] <= UPPER_N
, so really there's no point in the second conditional.
It's fine in short programs like this, but as you hinted that you're fairly to C++, I wanted to mention that this can be a bad habit to get into. In particular, in large applications with many different segments of code, this can cause naming clashes.
I would probably call rot
rot13
since there are other kinds of rotations. This is mainly me just being overly picky though :).
If this is not a bug, you should know that that this will be always be true if input[index] <= UPPER_N
, so really there's no point in the second conditional.
It's fine in short programs like this, but as you hinted that you're fairly new to C++, I wanted to mention that this can be a bad habit to get into. In particular, in large applications with many different segments of code, this can cause naming clashes.
I would probably call rot
, rot13
since there are other kinds of rotations. This is mainly me just being overly picky though :).
If this is not a bug, you should know that this will be always be true if input[index] <= UPPER_N
, so really there's no point in the second conditional.