C# help please

forspinki

Legend
Legendary
Oct 23, 2006
3,353
82
195
Handan, China
class Hello
{
static void Main()
{
System.Console.Writeline("Hello, World!");
}
}

Im using program called Editplus and i just wanted to make sure im doing it correct becuase in the guide it said remove the colons but what does that meen exactly -.-

should it just be

class Hello

static void Main()

System.Console.Writeline("Hello, World!");
 

1PKRyan

LOMCN Developer
Developer
Nov 9, 2007
1,536
149
275
No
System.Console.Writeline("Hello, World!");

the ; at the end of ) is a semi colon if that what it means
 

Liandrin2

Golden Oldie
Golden Oldie
Loyal Member
Jan 14, 2004
890
6
125
Colon = ":"

What you've got there looks fine.

The {} are important.
 
Last edited:

forspinki

Legend
Legendary
Oct 23, 2006
3,353
82
195
Handan, China
On the guide it shows the { } ect with spaces before it but on here the forum places them at the start if the sentence, does it materr if there's spaces or not



also where do I find the command line compiler as I need that, I'm only using this editor and visual C# 2008 express edition
 
Last edited:

1PKRyan

LOMCN Developer
Developer
Nov 9, 2007
1,536
149
275
No
Yeah it looks ok, didn't think it was asking to remove them as it Terminates that statement.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

http://msdn.microsoft.com/en-us/libr...63(VS.71).aspx

Show's a few different way's how todo Hello World programs, that EditPlus the compiler you using? because ive never used it so dunno how different it actualy is to the Visual Studio c#.
 
Last edited:

forspinki

Legend
Legendary
Oct 23, 2006
3,353
82
195
Handan, China
i found it but it wont open
womtoepmn.jpg


just opens up the comandline complier than closes again instantly
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,184
30
2,788
540
why dont you use visual studios?
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,184
30
2,788
540
ah right. guides like that neva help me, thats how i got taught in uni. i find it a much quicker way learning by finding a program u wanna make, then make it, and search how to do it along the way.
 

1PKRyan

LOMCN Developer
Developer
Nov 9, 2007
1,536
149
275
No
Yeah usualy you can't open them directly, i'll have a look around for you a lil more
see if i can find a way for you to do it.
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,184
30
2,788
540
in the command line you simply type

csc test.cs

which will compile test.cs in to test.exe

edit: if its the command prompt your having trouble opening, there should be a shortcut in ur start menu to open it (there is in visual studios anyway) csc isnt the prompt, its the compiler, so you cant open that directly.

alternatively, try dragging your test.cs file on to the csc.exe, that should also compile it.
 
Last edited: