delete file cpp
/* remove example: remove myfile.txt */
#include <stdio.h>
int main ()
{
if( remove( "myfile.txt" ) != 0 )
perror( "Error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
delete file cpp
/* remove example: remove myfile.txt */
#include <stdio.h>
int main ()
{
if( remove( "myfile.txt" ) != 0 )
perror( "Error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
c++ remove text file
#include <stdio.h>
int main ()
{
if( remove( "myfile.txt" ) != 0 )
perror( "Error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
how to delete a file in cpp
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
intstatus;
char fileName[20];
cout<<"Enter the Name of File: ";
cin>>fileName;
status = remove(fileName);
if(status==0)
cout<<"\nFile Deleted Successfully!";
else
cout<<"\nError Occurred!";
cout<<endl;
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us