下面代码将输出什么?
#include <iostream>
#include <string>
using namespace std;
int main() {
string str = "Hello,World!";
string sub = str.substr(2, 5);
for (int i = 0; i < sub.length(); i++) {
cout << sub[i];
}
return 0;
}
Ilo,W
ello,
ello
Compilation error