求C++大佬帮我排查一下程序的问题

是下面的一个判断回文数的小程序:
int main()
{
string a;
cin >> a;
const int c = a.length();
string b;
for (int i = 0; i < c; i++)
b[i] = a[c - i - 1];
if (a == b)cout << "yes";
else cout << "no";
}
```这个程序在visual studio 2019里没有提示错误,但是实际运行时总提示“string subscription out of range”,这是哪里错了呢?

也许是c的值有问题,可以写个变量输出c的值看看

图片说明
插入个断点一看就明白了。