C Program To Delete A File


♣ Try it Out ::
#include<stdio.h>
#include<conio.h>

main()
{
    int status;
    char fname[25];

    printf("Enter the file name which you wish to delete: ");
    gets(fname);

    status = remove(fname);

    if( status == 0 )
        printf("The %s file has been deleted successfully.", fname);
    else
    {
        perror("Error ");
    }

    getch();
    return(0);
}

♣ Output ::
Enter the file name which you wish to delete: muhit.txt
The muhit.txt file has been deleted successfully.

♣ Downloads ::

Comments

Popular posts from this blog

C++ :: Topological Sort Algorithm (using DFS)

How to Hack Facebook Account

C++ :: Strongly Connected Components Algorithm (SCC)