deleting all contents from a file

Is there simple code to just delete all contents from a binary file?

file.open("file", ios::out|ios::trunc);

this deletes all content when opened
great thanks!
Topic archived. No new replies allowed.