Horje
c++ write to file in directory Code Example
c++ write to file in directory
ofstream myFile("/Your/File/Path/YourFilename.txt");//writing to this file
if (myFile.is_open())
{
   myFile << "This is a line." << "\n";
   myFile << "This is another line." << "\n";
   myFile.close();
}
else
   std::cout << "Unable to open file";   




Cpp

Related
how to run cpp using gcc vscode Code Example how to run cpp using gcc vscode Code Example
how to get window size sfml Code Example how to get window size sfml Code Example
cpp ifstream Code Example cpp ifstream Code Example
How to loop through a set of pairs in c++ Code Example How to loop through a set of pairs in c++ Code Example
c++ foreach Code Example c++ foreach Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8