I assume you are trying to write a secure delete application?
That is not as easy as you think...
Google is your friend here: Secure delete c++
] - but be prepared for some work, it is not at all easy. Just think about SSDs - they don't write where they tell you they are, just mark the old blocks as "available for reuse" at a later date.