Reputation: 1692
I believe there is a function in stdio.h called remove()
that removes a file by passing in the file name like remove("foo.txt")
.
However, if I want to remove a file in a specified path, how do I do that?
Upvotes: 1
Views: 80
Reputation: 172
first check your program user rights allow to remove this file
second get full path like: remove("/home/test/foo.txt")
Upvotes: 1
Reputation: 16607
You can do this -
remove("drive\\folder\\foo.txt"):
Remember you have to put \\
between path. \
won't work compiler will show error.
Upvotes: 1