Clearning file contents

  • Thread starter Thread starter Harish
  • Start date Start date
H

Harish

I am doing file operations using fopen(),
fwrite(), fclose() group of functions.
At times I need to clear the file contents while
the file is open.
Is there a function in the same group to do it?
(Or a workaround other than closing and
reopening the file in write mode?)
--Harish
 
Harish said:
I am doing file operations using fopen(),
fwrite(), fclose() group of functions.
At times I need to clear the file contents while
the file is open.
Is there a function in the same group to do it?
(Or a workaround other than closing and
reopening the file in write mode?)
--Harish
Goto the very beginning of the file by means of the _lseek() function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top