Hello,
The following C++ test code should write a simple txt file in a specified folder in a remote server under CentOS:
#include <fstream>
#include <string>
int main(int argc, char* argv[])
{
std::string content = "This is a test content.";
std::string filename = "/myFolder/myFile.txt";
std::ofstream file;
file.open(filename.c_str());
file << content;
file.close();
return 0;
}
It compiles and works properly in gcc 5.3.1. While it does compile using VisualGDB, it surprisingly does not write actually the file.
The following post in stackoverflow (http://stackoverflow.com/questions/16779149/c-program-in-xcode-not-outputting-simple-text-file-using-outfile) seems to mention a similar issue in Xcode. It suggests this is merely a setting in VisualGDB.
How to set up VisualGDB in order to fix this problem?
Thank you for your time.
Jacques Burrus