1강 hello c#

tintwo·2022년 12월 26일

c#을 해보장

visual studio 커뮤니티 설치 .net

후 새 프로젝트 만들기

오늘은 가볍게 콘솔창에 hello world 를 찍어보기 위해

콘솔 앱으로 프로젝트를 생성하자.

디렉토리를 나눠서 할 생각이라 체크 해줬다.

.cs 는 c# 파일.

프로젝트 우클릭 -> 추가

using은 java에서 import와 같은 개념인듯

구조는 조금 다른데 결국 Main함수에서 실행되지 않을까 하는 생각이 든다.

namespace안에 Program이라는 class가 들어있고

window os 가 내 Class 즉, Program (helloCSharp.exe를 실행한다)

이 Program 안에는 여러 기능이 있을 수 있고, 하나의 기능만 있을 수도 있다.

Main이라는 function은 특별한, 가장먼저 실행되는 함수.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloCSharp
{
     class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Hello C#");
            Console.ReadKey();
        }
    }
}

profile
study records of beginner developer

0개의 댓글