CS 5001: Program does not contain a static 'Main' method test_test suitable for an entry point.
The above error is given then I try to run the program along with an error attracted to the txt file call in the main stating:
there is no argument given that corresponds to the required formal parameter 'arr' of 'txt_program.txt(string[][])'
Furthermore the program is an console app with the following code for an item:
namespace text_test
}
class txt_program
{
public void txt()
{
string[] string1 = new string[] {"a", "a", "a" };
string[] string2 = new string[] { "b", "b", "b" };
string[] string3 = new string[] { "c", "c", "c" };
string[][] names = new string[][] { string1, string2, string3 };
using (StreamWriter SW = new StreamWriter(@"txt.txt"))
{
for (int i = 0; i < 3; i++)
{
for (int a = 0; a < 3; a++)
{
Console.Write(" " + arr[i][a]);
}
Console.WriteLine();
}
}
}
}
}
The above code is called in the main by using the following code:
namespace text_test
{
class Program
{
static void Main(string[][] args)
{
new txt_program().txt();
}
}
}
The wished output is a textfile looking like the following:
a a a
b b b
c c c