#include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
string str1 = str[0]; // statement1
str1 = str[0]; // statement2
cout << str1 << endl;
}
Statement1 shows an error while statement2 runs fine. Could anyone please explain why this happens?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…