Deleting a file in C

This is a discussion on Deleting a file in C within the C Programming forums, part of the General Programming Boards category; Hi, How do you delete a file in the middle of your c program. I have where the file is.... ...

  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
    523
    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, 08: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, 08:51 PM
  3. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 04:44 PM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 09: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21