I try Draw(); and I get this:
Warning in TFile::Init: file four.root probably not closed, trying to recover
Info in TFile::Recover: four.root, recovered key TCanvas:c1 at address 214
Info in TFile::Recover: four.root, recovered key TCanvas:c1_n2 at address 3353
Info in TFile::Recover: four.root, recovered key TCanvas:c1_n3 at address 6400
Info in TFile::Recover: four.root, recovered key TCanvas:c1_n4 at address 9567
Warning in TFile::Init: successfully recovered 4 keys
In the “pads” function, try to use (this may remove the “segmentation violation”):
TCanvas *C = new TCanvas("C_four", "C_four");
Looking at the error from “Draw”, it seems to me that your “four.root” is broken (was not closed properly) and so your canvases are not properly stored.
void fourpads(){
auto c1 = new TCanvas(); c1->DrawFrame(0.,0.,1.,1.);
auto c2 = new TCanvas(); c2->DrawFrame(0.,0.,2.,2.);
auto c3 = new TCanvas(); c3->DrawFrame(0.,0.,3.,3.);
auto c4 = new TCanvas(); c4->DrawFrame(0.,0.,4.,4.);
auto FourPads = new TCanvas("FourPads","FourPads");
FourPads->Divide(2,2);
FourPads->cd(1) ; c1->DrawClonePad();
FourPads->cd(2) ; c2->DrawClonePad();
FourPads->cd(3) ; c3->DrawClonePad();
FourPads->cd(4) ; c4->DrawClonePad();
}