Visual Studio 2019 is acting like this static void Main() doesn’t exist.
using System;
namespace Paint
{
class Program
{
void static Main(string[] args)
{
Paint();
}
void Paint()
{
string[] tiles = new string[256];
var newkey = Console.Read();
int paint = Convert.ToInt32(newkey);
tiles[paint] = "Test";
Console.WriteLine(tiles[paint]);
Console.Beep();
Console.ReadKey();
Paint();
}
}
}
I tried to put the Main() at the front of the function, but that didn’t work.
>Solution :
your problem is
#1.add static before Methods
#2.change Name Method
#3.comment // Paint();
if you want recursive or repeat Method that you must review and change your code
this is correct code
using System;
namespace Paint;
class Program
{
static void Main(string[] args)
{
Paintn();
}
static void Paintn()
{
string[] tiles = new string[256];
var newkey = Console.Read();
int paint = Convert.ToInt32(newkey);
tiles[paint] = "Test";
Console.WriteLine(tiles[paint]);
Console.Beep();
Console.ReadKey();
// Paint();
}
}