/Вывод
for (int i = 0; i < 10; i++) {
std::cout << src[i] << std::endl;
}
. Далее , измените вопрос, добавьте конкретику, что у вас не работает , или результат выполнения программы или ошибки компиляции #include <iostream>
#include <vector>
#include <fstream>
#include <string>
using namespace std;
int main() {
std::string src;
std::string temp;
src="";
temp = "<keyMaterial>my text here!1" ;
src += temp;
temp = "dfvdfsdfdsfmy text here!2</keyMaterial>" ;
src += temp;
size_t begin = src.find("<keyMaterial>") + 13;
size_t end = src.find("</keyMaterial>");
src = src.substr(begin, end - begin);
//Вывод
std::cout << src;
return 0;
}