기본 콘텐츠로 건너뛰기

[C#] C# 프로그램의 일반적인 구조(A skeleton of a C# program)


// A skeleton of a C# program 
using System;
namespace YourNamespace
{
    class YourClass
    {
    }

    struct YourStruct
    {
    }

    interface IYourInterface 
    {
    }

    delegate int YourDelegate();

    enum YourEnum 
    {
    }

    namespace YourNestedNamespace
    {
        struct YourStruct 
        {
        }
    }

    class YourMainClass
    {
        static void Main(string[] args) 
        {
            //Your program starts here...
        }
    }
}

By Microsoft.MSDN :: .NET Guide Docs

이 블로그의 인기 게시물

[C#] 연산자 목록(Operators)

[C#] 간결한 식(expression)

[ 기본 간결식 ] member => expression; (example 1 : 메서드) using System; public class Person { public Person(string firstName, string lastName) { fname = firstName; lname = lastName; } private string fname; private string lname; public override string ToString() => $"{fname} {lname}".Trim(); public void DisplayName() => Console.WriteLine(ToString()); } class Example { static void Main() { Person p = new Person("Mandy", "Dejesus"); Console.WriteLine(p); p.DisplayName(); } } (example 2 : 생성자) public class Location {    private string locationName;    public Location(string name) => Name = name;    public string Name    {       get => locationName;       set => locationName = value;    } } (example 3 : 종료자) using System; public class Destroyer {    public override string ToString() => GetT...