c++ - How to change the extension of a file? -


i working on project need add message @ end of file , want change extension.

i know how add message @ end of file; code:

_ofstream myfile; _myfile.open("check.txt", std::ios_base::app); _myfile << "thanks help.\n"; 

how can change file's extension?

actualy, simple:

#include <iostream> #include <fstream> #include <cstdio>   using namespace std;   int main(int argc, char* argv[]) {      ofstream fout("test.txt", ios_base::app);     fout << "my cool string";     fout.close();     rename("test.txt", "test.txt1");      return 0; } 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -