Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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<<"
File Deleted Successfully!";
    else
        cout<<"
Error Occurred!";
    cout<<endl;
    return 0;
}
Source by codescracker.com #
 
PREVIOUS NEXT
Tagged: #delete #file #cpp
ADD COMMENT
Topic
Name
2+2 =