yaw-audio/lib/rasa/cs.cpp

25 lines
607 B
C++
Raw Normal View History

2022-09-22 21:55:25 +00:00
//File for C# <-> C++/CLI interface
#ifdef YAW_USE_OTD
// text_write.cpp
// compile with: /clr
using namespace System;
using namespace System::IO;
int func()
{
String^ fileName = "textfile.txt";
StreamWriter^ sw = gcnew StreamWriter(fileName);
sw->WriteLine("A text file is born!");
sw->Write("You can use WriteLine");
sw->WriteLine("...or just Write");
sw->WriteLine("and do {0} output too.", "formatted");
sw->WriteLine("You can also send non-text objects:");
sw->WriteLine(DateTime::Now);
sw->Close();
Console::WriteLine("a new file ('{0}') has been written", fileName);
return 0;
}
#endif