Venkat wrote in
These function's take arguments that are filenames and have type
char const *, they don't have anything to do with fstream's or
First close any open fstream's you have associated with the file,
then call
std::rename( "oldname", "newname" ); or
std::remove( "oldname" );
Replace "oldname"/"newname" with the appropriate literals or
char const *varaible, or use std::string's c_str() member:
std::string name = "filename";
std::ifstream ifs( name.c_str() );
// read something from ifs;
ifs.close();
std::remove( name.c_str() );
Also to add, std::rename and std::remove are throwing compile errors
saying rename and remove are not members of std, even after including
<cstdio> library.
How are you calling them, whats the error and what compiler are you
using. Prefereably post some actual code (cut & paste) that doesn't
compile.
HTH.
Rob.