Thread: Deleting a file in C

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    4

    Unhappy Deleting a file in C

    Hi,

    How do you delete a file in the middle of your c program.

    I have where the file is....

    TCHAR buf[128];

    and buf is "c:\\somewhere\\file.txt"

    Pls help....
    Matt

  2. #2
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    522
    You can use the remove function to delete files
    Code:
    int remove(char *filename)
    returns zero if successful.
    or do you mean a record in that file?
    All spelling mistakes, syntatical errors and stupid comments are intentional.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  2. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  3. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM