KO CSharp Operator Increment - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
์ฆ๊ฐ ๋ฐ ๊ฐ์
ํธ๋๋ถ C# ยท ์ค์ฉ ๊ฐ์ด๋
์ ๋์ฌ๋ ์ ๊ฐ์ ๋ฐํํฉ๋๋ค. ์ ๋ฏธ์ฌ๋ ์ด์ ๊ฒ์ ๋ฐํํฉ๋๋ค. ๋ ํ์ ๋ชจ๋ ๋ณ์๋ฅผ ์์ ํฉ๋๋ค.
๊ฐ๋จํ ์์ (Example.cs)
์ด ์์ ๋ฅผ Example.cs๋ก ๋ฐ๋ก ์ ์ฅํ๊ณ ์ด ํ์ด์ง์ ๋ค๋ฅธ ์์ ์ ๋
๋ฆฝ์ ์ผ๋ก ์คํํ์ธ์.
Example.cs:
// PROJECT-EXAMPLE
int count = 2;
System.Console.WriteLine(count++);
System.Console.WriteLine(++count);
๊ฒฐ๊ณผ:
2
4
ํต์ฌ๋ก
++value / value++ / --value / value--
์์ 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
int value = 2;
Console.WriteLine(value++); Console.WriteLine(++value);
Console.WriteLine(value--); Console.WriteLine(--value);
}
}
์์ 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
int[] values = [10, 20, 30];
int index = 0;
while (index < values.Length) Console.WriteLine(values[index++]);
}
}
๊ณต์ ์ถ์ฒ: Microsoft ํ์ต.