I am having the same problem repeatedly, with no success. I keep getting this error:
Type or namespace definition, or end-of-file expected
I have it twice on two curly braces at the end of my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Asrai
{
class Program
{
public int health = 100;
public int damage = 0;
public static int hit = 0;
static void Main(string[] args)
{
if (hit == 1)
{
int operator -(int health,int damage);
}
}
}
}
It is probably something simple that I overlooked, but I can’t see anything wrong with this code
Do this
Both health and damage need to be static in order for them to be accessible from a static context (in this case the Main method)
PS: You should have noticed that your code is wrong simple from the highlighting that this website does to this line of code
int is a type. what business would it have in that line of code ?