์ ์ฒด ๊ธ
1. ์ฝ์ C# ํ๋ก๊ทธ๋จ์ ์ดํด (using, using static, namespace, CLR)
using System; using static System.Console; namespace Hello { //ํ๋ก๊ทธ๋จ ์คํ์ด ์์๋๋ ๊ณณ class MainApp { static void Main(string[] args) { if(args.Length == 0) { Console.WriteLine("์ฌ์ฉ๋ฒ : Hello.exe"); return; } WriteLine("Hello, {0}!",args[0]); } } } using System; //System ๋ค์์คํ์ด์ค ์์ ์๋ ํด๋์ค๋ฅผ ์ฌ์ฉํ๊ฒ ๋ค๊ณ ์ปดํ์ผ๋ฌ์๊ฒ ์๋ฆผ //System.Console.WriteLine์ Console.WriteLine๋ก ์ค์ฌ์ธ ์ ์๊ฒ ํด์ค using static System.Console; //Console.Wr..
[C# ์๋ฃ๊ตฌ์กฐ] ๋์ ๋ฐฐ์ด(List: C++vector์ ์ ์ฌํจ) ๊ตฌํ
Board ํด๋์ค ์์์ List๋ฅผ ์จ๋ณด๊ณ , ๊ทธ List์ ๋์ ๋ฐฐ์ด ๋ก์ง์ ์ง์ ๊ตฌํํ๋ ์ฝ๋ List using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Algorithm { class Board { public int[] _data = new int[25]; //๋ฐฐ์ด public List _data2 = new List(); //๋์ ๋ฐฐ์ด public LinkedList _data3 = new LinkedList(); //(์ด์ค)์ฐ๊ฒฐ ๋ฆฌ์คํธ public void Initialize() { _data2.Add(101); _data..
[C# ์๋ฃ๊ตฌ์กฐ] ์ ํ ์๋ฃ ๊ตฌ์กฐ ( ๋ฐฐ์ด vs ๋์ ๋ฐฐ์ด vs ์ฐ๊ฒฐ ๋ฆฌ์คํธ)
public int[] _data = new int[25]; //๋ฐฐ์ด public List _data1 = new List(); //๋์ ๋ฐฐ์ด public LinkedList _data3 = new LinkedList(); //(์ด์ค)์ฐ๊ฒฐ ๋ฆฌ์คํธ **์ฃผ์ C++๊ณผ ํผ๋๋ ์ ์๋๋ฐ C#์์์ List๋ C++์์์ Vector, C#์์์ LinkedList๋ C++์์์ List ๊ฐ๊ฐ ๋์ํด์ ๋น์ทํ๊ฒ ์ง์ฌ์ง ์๋ฃ๊ตฌ์กฐ์ด๋ค. ์ ํ ๊ตฌ์กฐ๋ ์๋ฃ๋ฅผ ์์ฐจ์ ์ผ๋ก ๋์ดํ ํํ - ๋ฐฐ์ด - ์ฐ๊ฒฐ ๋ฆฌ์คํธ - ์คํ / ํ ๋น์ ํ ๊ตฌ์กฐ๋ ํ๋์ ์๋ฃ ๋ค์ ๋ค์์ ์๋ฃ๊ฐ ์ฌ ์ ์๋ ํํ - ํธ๋ฆฌ - ๊ทธ๋ํ 1. ๋ฐฐ์ด (1) ์ฅ์ : ์ฐ์์ฑ(์์ ์ ๊ทผ Random Access ๊ฐ๋ฅ) (2) ๋จ์ : ์ฌ์ด์ฆ ์ถ๊ฐ / ์ถ์ ..
[C# ์ฝ์] 5x5 ๋๊ทธ๋ผ๋ฏธํ ์ถ๋ ฅ
using System; namespace Algorithm { class Program { static void Main(string[] args) { Console.CursorVisible = false; const int WAIT_TICK = 1000 / 30; const char CIRCLE = '\u25cf'; int lastTick = 0; while(true) { #region ํ๋ ์ ๊ด๋ฆฌ //๋ง์ฝ์ ๊ฒฝ๊ณผํ ์๊ฐ์ด 1/30์ด ๋ณด๋ค ์๋ค๋ฉด int currentTick = System.Environment.TickCount; if (currentTick - lastTick < WAIT_TICK) continue; lastTick = currentTick; #endregion //์ ๋ ฅ //๋ก์ง /..
C++ ์๋ฌธ์๋ฅผ ๋๋ฌธ์๋ก ๋ณํํ๊ธฐ
[C/C++]๋๋ฌธ์๋ฅผ ์๋ฌธ์๋ก ์๋ฌธ์๋ฅผ ๋๋ฌธ์๋ก ๋ณํํ๊ธฐ (tistory.com)
[์ํ๊ณผ ๋ฐ๋ณต] ํฉํ ๋ฆฌ์ผ ๊ณ์ฐ ํ๋ก๊ทธ๋จ
ํฉํ ๋ฆฌ์ผ์ ์ํ, ๋ฐ๋ณต ๊ฐ๋ ์ ๋ง์ถ์ด์ ํ๋ก๊ทธ๋จ์ ์ง๋ฉด ๋ค์๊ณผ ๊ฐ๋ค. 1. ์ํ #include #include #include using namespace std; int factorial(int n) { cout
C++ ์ซ์ ๊ฐ ์๋ฆฟ์ ๊ตฌํ๊ธฐ, ๋ฌธ์์ด ์ซ์ ๊ฐ ์๋ฆฟ์ ๊ตฌํ๊ธฐ
C++ ์ซ์ ๊ฐ ์๋ฆฟ์ ๊ตฌํ๊ธฐ, ๋ฌธ์์ด ์ซ์ ๊ฐ ์๋ฆฟ์ ๊ตฌํ๊ธฐ (tistory.com)