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 :: g++ optimization flags 
Cpp :: queue implementation using linked list in cpp 
Cpp :: c++ array loop 
Cpp :: c++ looping 
Cpp :: how to check if a value is inside an array in c++ 
Cpp :: copy 2 dimensional array c++ 
Cpp :: how to clear console c++ 
Cpp :: calculator c++ 
Cpp :: character array to string c++ stl 
Cpp :: max function in c++ 
Cpp :: use ::begin(WiFiClient, url) 
Cpp :: reverse string c++ 
Cpp :: substring to int c++ 
Cpp :: bubble sort in c+ 
Cpp :: sleep system function linux c++ 
Cpp :: height of bst cpp 
Cpp :: Resize method in c++ for arrays 
Cpp :: cpp float to string 
Cpp :: string iterator in c++ 
Cpp :: splice string in c++ 
Cpp :: c++ colored output 
Cpp :: comparator for priority queue c++ 
Cpp :: migration meaning 
Cpp :: console colors in C++ 
Cpp :: c++ public class syntax 
Cpp :: how to initialize a vector of pairs in c++ 
Cpp :: c++ add to array 
Cpp :: See Compilation Time in c++ Program 
Cpp :: getline(cin string) not working 
Cpp :: convert 2d array to 1d c++ 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =