![[C#] 6일차 - 32. 열거형 enum](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fda55QJ%2FbtqT6HAFIWJ%2FAAAAAAAAAAAAAAAAAAAAABdWRHDpnIsVSDqdp49y4YbETWqD7o-PZpIRKx7Sbn4D%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DQLSDG1s1khZ2%252FuIXOZiltMDYHQ8%253D)
열거형은 서로 관련 있는 상수들의 집합을 정의한 것. 숫자에 특정한 명칭을 붙여 쉽게 이해할 수 있는 용도로 사용된다 원소로 기술된 명칭을 기호 상수라고 부르며, 순서에 따라 default=0 부터 순서대로 정수값을 갖게 된다. enum Day {Sat, Sun, Mon, Tue, Wed, Thu, Fri} 기호상수의 값을 별도로 지정할 수 도 있다. enum Day { Sat=1, Sun, Mon, Tue, Wed, Thu, Fri=10 }; 열거형 값을 정수로 대입할 떄는 다음과 같이 (int)로 캐스팅한다. int x = (int)Day.Sun; enum문은 class안이나 namespace내에서만 선언될 수 있다. 다른곳에서는 Enum클래스에서 제공하는 GetValues()나 GetNames()를..
![[C#] 5일차 (문자, 문자열 정리)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcS0Rgt%2FbtqT7WpErff%2FAAAAAAAAAAAAAAAAAAAAAFyFvzzBBdJza3ITdg2WlatoIcHt7-DWUJUaQTtFOQk7%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DgVu9p%252BI7wCJjfwmKEOBL3vCulK4%253D)
24. 증가연산자, 감소연산자와 대입연산자의 압축 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A024_ConpoundAssignment { class Program { static void Main(string[] args) { int x = 32; Console.WriteLine(x += 2); Console.WriteLine(x -= 8); Console.WriteLine(x *= 3); Console.WriteLine(x /= 2); Console.WriteLine(x++ ); Console.WriteLine(--x);..
![[C#] 4일차 ( try~catch문, 각종 연산자 )](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FmProb%2FbtqT18DpcKH%2FAAAAAAAAAAAAAAAAAAAAAPy9gw5ntRm0q91Xmf2KVGhXCvnILPLuYXvCsFe2YcOT%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DHrrFZUxwgsKW1wPZLp4O6wH9Alg%253D)
18. DivideByZeroException과 try~catch문 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A018_DivideByZero { class Program { static void Main(string[] args) { int x = 10, y = 0; Console.WriteLine(10.0 / y); Console.WriteLine(x / y); } } } 10.0 / y 는 실수를 0 으로 나누기때문에 무한을 출력 x / y를 할때 y값이 0 이기 때문에 0으로 나눔 예외가 발생 Try~Catch 문으로..
![[C#] 3일차 ( Format과 연산자 처리)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FLd3zs%2FbtqTJnh8Q2G%2FAAAAAAAAAAAAAAAAAAAAAFRfqYAvzjSY0ToGrIa9G2OYP5Cob95q5dhKYbI6R-cA%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3D7reZTTo%252F%252FfEgrMnkkuRry%252FbIjLE%253D)
11. 형식지정자를 사용한는 String.Format()과 ToString using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace A011_FormatSpecifier { class Program { static void Main(string[] args) { Console.WriteLine("{0:N2}", 1234.5678); Console.WriteLine("{0:D8}", 1234); Console.WriteLine("{0:F3}", 1234.56); Console.WriteLine("{0:8}", 1234); Console.Wr..
클래스 라이브러리 C#언어 + 클래스 라이브러리 = C# 프로그래밍 MSDN을 참고 ( msdn.Microsoft.com ) BCL(Basic Class Library) : 기본 클래스 Window Form : 윈도우 응용 프로그램 제작을 위한 클래스 라이브러리 ASP.NET : 웹 클래스 라이브러리 ADO.NET : DB클래스 라이브러리 CLR(Common Language Runtime) 역할 : 컴파일된 C#코드를 실행하는 역할 MSIL, IL(intermediate Language), 중간언어 Visual Studio에서 C#코드를 컴파일한 코드 *.exe, *.dll (assembly) .NET언어인 VB, C#등의 공통언어 CTS(Common Type System) : 공통 자료형과 형식정의 i..