ahmed0saber

Delete a file in C

Nov 4th, 2020
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.17 KB | None | 0 0
  1. #include <stdio.h>
  2. int main ()
  3. {
  4.   if( remove( "D:\\a1.txt" ) != 0 )
  5.     perror( "Error deleting file" );
  6.   else
  7.     puts( "File successfully deleted" );
  8.   return 0;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment