Program body
#include iostream
#include string
#include fstream
using namespace std;
int main (){
fstream file;
file.open("sabi.txt",ios:: in |ios :: out | ios :: trunc);
if(file.is_open()){
cout<<"File opened successfully"<<endl;
}else {
cout<<"an error while opening file"<<endl;
}
file.close();
}
Working of program
this is what is shown when you have any file you specified before like here (sabi.txt)
I hope you enjoyed it
sorry The v shaped things around iostream etc can't be placed here as they are html componenets too
good one, did you miss adding library names with include statements ?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
sorry I did I guess.. haha
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
More of this would be highly appreciated
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
amazing as ever @learnandgrow
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
great one
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit