S
smilesonisamal
Hi all,
I have a output file which is generated by a tool. I want to check
whether the file exists or not. If exists then delete it and invoke
the tool. Which one will be suitable for this case ifstream or
ofstream to open the file?
ifstream in;
in.open(xxx,std::ios::in);
if (in)
{
in.close();
in.clear();
remove(xxx);
.}
I have a output file which is generated by a tool. I want to check
whether the file exists or not. If exists then delete it and invoke
the tool. Which one will be suitable for this case ifstream or
ofstream to open the file?
ifstream in;
in.open(xxx,std::ios::in);
if (in)
{
in.close();
in.clear();
remove(xxx);
.}