You are here: Home » C# » Using StreamWriter: Writes an Array of characters

Using StreamWriter: Writes an Array of characters



Using StreamWriter: Writes an Array of characters

Add to my Favourite
using System;
using System.IO;

public class MainClass
{
  static void Main(string[] args)
  {
    StreamWriter MyStreamWriter = new StreamWriter(@"c:\Testing.txt");

    char[] MyCharArray = new char[100];

    for (int i = 0; i < 99; i++)
    {
      MyCharArray[i(char)i;
    }

    MyStreamWriter.Write(MyCharArray);

    MyStreamWriter.Close();
  }
}