Q:

what is the difference between char('a'+1) and 'a' + 1 and static_cast(i)?

So I'm trying to print a table of characters with their corresponding integer values. Below is my code:-
#include <iostream>

using namespace std;

int main()
{
    char i = 'a';
    while (i <= 'z')
    {
        cout << i << '\t' << 'a' + 1 << '\n';
        ++i;
    }
}

I tried to put char('a' + 1) in the code which gave me a whole lot of wrong answers.
Output(correct output) I get by using static_cast in code:- 
a  97
b  98
c  99
....
z  122
Output I'm getting using the above written code:-
a  98
b  98
.....
z  98
So i would like to know what is the difference between char('a'+1) and 'a' + 1 and static_cast(i)?

A:

The type of expression 'a' + 1 is int. 
Note that there is no char operator+(char, char), but there is int operator+(int, int). This is why a gets promoted to int and there result of the expression is int. See Integral promotion for more details:

In particular, arithmetic operators do not accept types smaller than int as arguments, and integral promotions are automatically applied after lvalue-to-rvalue conversion, if applicable. This conversion always preserves the value.

Whereas char('a' + 1) is char because it explicitly casts int 'a' + 1 to char.

