How do I rename a file with a string using the rename() function (c++)? [closed]

It’s hard to say, but have you tried that:

rename("tmp.png", Filename.c_str());

If Filename is a std::string std::string::c_str() converts it to a const char*, which is maybe what needs your rename function as second argument?

If you are trying to use standard rename function, this may solve your problem.

Browse More Popular Posts

Leave a Comment