Write entire file: Difference between revisions

Added C++
No edit summary
(Added C++)
Line 91:
</lang>
 
=={{header|C++}}==
<lang cpp>#include <fstream>
using namespace std;
 
int main()
{
ofstream file("new.txt");
file << "this is a string";
file.close();
return 0;
}</lang>
=={{header|C#}}==
<lang csharp>System.IO.File.WriteAllText("filename.txt", "This file contains a string.");</lang>