need delete a file in vc++
-
hi, i want to know that,how to delete a particuler file using a path in vc++ i knew that DeleteFile() ,resolve it...but i have a piece of code ..will show below..can u give me the solution .. i stored the path in Dir, Dir = "d:\testapp\abc.exe" now delete a file: deletefile(Dir);//if i take path like this then this function will delete it. //("d:\\testapp\\abc.exe") now i want to delete this file using single slash("\") inside path.. anybody know???
-
hi, i want to know that,how to delete a particuler file using a path in vc++ i knew that DeleteFile() ,resolve it...but i have a piece of code ..will show below..can u give me the solution .. i stored the path in Dir, Dir = "d:\testapp\abc.exe" now delete a file: deletefile(Dir);//if i take path like this then this function will delete it. //("d:\\testapp\\abc.exe") now i want to delete this file using single slash("\") inside path.. anybody know???
You will have to use '\\' to represent a single '\' character in C/C++ because, anything coming after a single '\' is considered as an escape sequence in C/C++. http://msdn.microsoft.com/en-us/library/h21280bw(VS.100).aspx[^]
-
hi, i want to know that,how to delete a particuler file using a path in vc++ i knew that DeleteFile() ,resolve it...but i have a piece of code ..will show below..can u give me the solution .. i stored the path in Dir, Dir = "d:\testapp\abc.exe" now delete a file: deletefile(Dir);//if i take path like this then this function will delete it. //("d:\\testapp\\abc.exe") now i want to delete this file using single slash("\") inside path.. anybody know???
Hi kamalilam,
kamalilam wrote:
now i want to delete this file using single slash("\") inside path..
As per C++ Character Constants[^], \ has special meaning in strings. So - "d:\\testapp\\abc.exe" is really "d:\testapp\abc.exe". Best Regards, Jijo.
_____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.