Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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;
}
Comment

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: run cmd command c++ 
Cpp :: cout hex c++ 
Cpp :: c++ string element access 
Cpp :: cstring to string 
Cpp :: c++ cout format 
Cpp :: function c++ 
Cpp :: c++ hello world 
Cpp :: use uint in c++ 
Cpp :: c++ string size 
Cpp :: sort a vector c++ 
Cpp :: C++ break with for loop 
Cpp :: c++ fstream create if not exists 
Cpp :: c++ vector resize 
Cpp :: cpp absolute value 
Cpp :: detect cycle in an undirected graph 
Cpp :: c++ struct 
Cpp :: fizzbuzz c++ 
Cpp :: string search c++ 
Cpp :: compute power of number 
Cpp :: descending order c++ 
Cpp :: c++ in cmd 
Cpp :: gcc suppress warning inline 
Cpp :: c++ #define 
Cpp :: vector iterating in c++ 
Cpp :: hashmap c++ 
Cpp :: unpack tuple c++ 
Cpp :: resize vector c++ 
Cpp :: int max in c++ 
Cpp :: google test assert stdout 
Cpp :: c++ delay 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =