Hello,
I am trying to write a simple program which should read the first line from the file s1,
and display it. When I run it , I get the message
cannot implicitly convert 'System.IO.Streamreader 'to 's1.Program'
which happens for the line Program re = new StreamReader("s1.txt");
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace s1
{
class Program
{
static void Main(string[] args)
{
Program re = new StreamReader("s1.txt");
s = re.Readline();
System.Console.WriteLine(s);
System.Console.WriteLine("Hello, World!");
}
}
}