Horje
how to delete a file in 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
strring length in c++ Code Example strring length in c++ Code Example
how can we create 4 digit random number in c++ Code Example how can we create 4 digit random number in c++ Code Example
lambda function qt connect Code Example lambda function qt connect Code Example
prime factorisation of a number in c++ Code Example prime factorisation of a number in c++ Code Example
input full line as input in cpp Code Example input full line as input in cpp Code Example

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