void check_file() { char cid[255], line[200]; sprintf(cid,"test.txt"); ifstream fin1(cid); ofstream fout(cid,ios::app); if(fin1.fail()) { cout<<"file does not exist"< root -l -q -b check_file.C Applying ATLAS style settings... root [0] Processing check_file.C... file does not exist  <-------- ないので作る 次回は > root -l -q -b check_file.C Applying ATLAS style settings... root [0] Processing check_file.C... file exist, 1st letter is test.txt <--------ある