#include <iostream>
#include <string>
using namespace std;
int main() {
string str {5, 'c'};
cout << str; // "\005c"
}
Output: cInitialisieren C++ String mit Ganzzahl- und Zeichen
Mit GDB, es wird bestätigt, dass str "\ 005C" mit str [0] = '\ 005' enthält str [1] = ' c '
Warum str [0] wird nicht in der Ausgabekonsole gedruckt? Verwendete C++ - Version: C++ 11
ASCII-Code 5 ist kein druckbares Zeichen ... – John3136