3
Answers

C# Streams

Administrator

Administrator

21y
1.4k
1
Does anyone know how to convert this Java code or C++ code to C#. The C# StreamWriter constructor takes a stream as an argument. Java: Class Example { private PrintStream _myOut; public Example(PrintStream s) { _myOut = new PrintStream(s); } public static void main(String args[]) { Example e = new Example(System.out); } }; C++: class Example { private: ostream& _myOut public: Example(ostream& s): _myOut(s) {} } main: Example e = new Example(cout); So how do you do it in C#?

Answers (3)