Getting " type of namespace definition, or end-of-file expected error"
using System;
namespace test
{
public class multiplying
{
public static void Main( string[] args);
{ //getting invalid '{' token here
int number1;
int number2;
int total;
}
}
} // getting type of namespace definition, or end-of-file expected error here
The programme isn't f开发者_如何学Goinished obviously but when I write more in I just get more errors so there must be something wrong here but I don't know what.
public static void Main( string[] args);
should be
public static void Main( string[] args)
You have an extra semi-colon here : public static void Main( string[] args);
public static void Main( string[] args);
You have an extra ;
there.
I'm not that familiar with C#, but I think this is your problem:
public static void Main( string[] args);
{ //getting invalid '{' token here
;
is ending the declaration, so the {
is considered completely separate (and don't make sense without a function signature coming first. Try changing it to this:
public static void Main( string[] args)
{
You have a ; after the closing bracket of the argument list.
精彩评论