Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie needs some help Compler errors for hello.cs

Status
Not open for further replies.

dporrelli

Programmer
Dec 18, 2002
43
GB
Hi guys & gals.
I've just done the tradidtional hello world prog as my starter. Downloaded the latest .net framework from ms and followed all the instructions on the tutorial, renamed the text file to .cs and typed 'csc hello.cs'. I get the errors 'CS00116: A namespace does not directly contain members such as fields or methods'
'CS1518: Expected class,delegate,enum,inferace,or struct'
'CS1022: Type or namespace definition,or end of file expected'.

Here is my code:
Using System;
Class Hello {
Public static voice Main() {
Console.writeLine("Hello World!!!");
}
}//end main

Tried reading the tutorials,but they are just confusing me just now.

Thanks in advance for any help.

Del
 
Code:
using System;

namespace HelloWorld
{
	class Hello
	{
		[STAThread]
		static void Main()
		{
			Console.WriteLine("Hello World!!!");
		}
	}
}
 
voice main?

surely you mean void main()

--------------------
Procrastinate Now!
 
Crowley16 - Thanx,

I couldnt see the spelling mistake, I am now bashing my head of my desk repeatedly.

Also SgtPeppa, thanx for the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top