Dear all,
I have some confusion regarding to simple situation. I would like to save 288 hists with their own name in std::vector, so to access it easily later and fill.
std::vector<TH1F*>hists;
for (int i =0; i < 288; i++){
TH1F* histName = new TH1F(Form("resTime-OM%s", i), Form("resTime-OM%s", i), 500, -100, 100);
hists.push_back(histName);
delete histName; histName = nullptr;
}
But my program crashes at 3rd line when i=1. Can anyone clarify why this is happening?