Horje
delete file cpp Code Example
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;
}
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;
}




Cpp

Related
c++ static method call Code Example c++ static method call Code Example
comment in c++ Code Example comment in c++ Code Example
Using find in Vector c++ Code Example Using find in Vector c++ Code Example
heap c++ stl Code Example heap c++ stl Code Example
c++ split string by several space Code Example c++ split string by several space Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12