250x250
Rainbow๐ŸŒˆCoder
My dev Note๐Ÿ“’
Rainbow๐ŸŒˆCoder
์ „์ฒด ๋ฐฉ๋ฌธ์ž
์˜ค๋Š˜
์–ด์ œ
  • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (411)
    • ๊ณต์ง€์‚ฌํ•ญ (0)
    • Debugger (10)
      • Visual Studio Debugger (1)
      • Chrome DevTools (3)
      • Visual Studio Code Debugger (4)
      • eclipse (1)
      • intelliJ (1)
    • OOP (2)
      • OOP (2)
    • TypeScript (54)
      • ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ TypeScript (54)
    • Javascript (87)
      • Javascript (45)
      • Node.js (19)
      • React (5)
      • FE ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ค์ • (3)
      • React์™€ Node ๊ฐ™์ด ๋•Œ๋ ค์žก๊ธฐ (6)
      • next.js (2)
      • pixi.js (7)
    • ๋งˆํฌ์—… (23)
      • Html & Css (23)
    • C# (80)
      • C# (12)
      • ์ด๊ฒƒ์ด C#์ด๋‹ค (68)
    • C++ (30)
      • c++ (27)
      • win api (3)
    • Unity (18)
      • Unity(๊ธฐ์ดˆ) (8)
      • Unity(C#์ค‘๊ธ‰) (5)
      • ์œ ๋‹ˆํ‹ฐ ํฌํ†ค(๋„คํŠธ์›Œํฌ) (4)
      • unity c# MyCode (1)
    • Java & Spring (29)
      • Java (11)
      • ์Šคํ”„๋ง (8)
      • Java Algorithm (9)
      • Javs Data Structures (1)
    • ์ž๋ฃŒ๊ตฌ์กฐ์™€ ์•Œ๊ณ ๋ฆฌ์ฆ˜ (15)
      • ์ž๋ฃŒ๊ตฌ์กฐ (5)
      • ์•Œ๊ณ ๋ฆฌ์ฆ˜ (10)
    • ํ˜•์ƒ๊ด€๋ฆฌ (15)
      • Git (11)
      • ์†Œ์ŠคํŠธ๋ฆฌ (3)
    • ๊ทธ๋ž˜ํ”ฝ์Šค (7)
      • WebGl (7)
    • AWS (3)
      • aws (3)
    • ๋ฆฌ๋ˆ…์Šค (5)
      • ๋ฆฌ๋ˆ…์Šค (5)
    • ์ฑ… ๋ฆฌ๋ทฐ (13)
      • ํด๋ฆฐ์ฝ”๋“œ(์ฑ…๋ฆฌ๋ทฐ) (3)
      • ์œ ์ง€๋ณด์ˆ˜๊ฐ€๋Šฅํ•œ์ฝ”๋”ฉ์˜๊ธฐ์ˆ C#ํŽธ(์ฑ…๋ฆฌ๋ทฐ) (1)
      • ๋ฆฌํŒฉํ† ๋ง(์ž๋ฐ”์Šคํฌ๋ฆฝํŠธํŒ) (9)
    • Server (2)
      • ๊ฒŒ์ž„ ์„œ๋ฒ„(๋„คํŠธ์›Œํฌ, ๋ฉ€ํ‹ฐ์“ฐ๋ ˆ๋“œ,OS) (2)
    • ์„ค๊ณ„, ์•„ํ‚คํ…์ณ (4)
    • ํŒŒ์ด์ฌ (5)
    • ๋””์ž์ธํŒจํ„ด (2)
    • mocha (2)
    • Jest (1)
    • Spine (1)
    • ์ธ๊ณต์ง€๋Šฅ (1)
      • ํ˜ผ์ž๊ณต๋ถ€ํ•˜๋Š”๋จธ์‹ ๋Ÿฌ๋‹+๋”ฅ๋Ÿฌ๋‹ (1)

๋ธ”๋กœ๊ทธ ๋ฉ”๋‰ด

  • ํ™ˆ
  • ํƒœ๊ทธ
  • ๋ฐฉ๋ช…๋ก

๊ณต์ง€์‚ฌํ•ญ

์ธ๊ธฐ ๊ธ€

ํƒœ๊ทธ

  • ใ…ฃใ„ท
  • ์ปดํฌ์ง€์…˜
  • ์œ„์ž„
  • MySQL

์ตœ๊ทผ ๋Œ“๊ธ€

์ตœ๊ทผ ๊ธ€

ํ‹ฐ์Šคํ† ๋ฆฌ

hELLO ยท Designed By ์ •์ƒ์šฐ.
Rainbow๐ŸŒˆCoder

My dev Note๐Ÿ“’

Array.CreateInstance ๋ฉ”์„œ๋“œ
C#/C#

Array.CreateInstance ๋ฉ”์„œ๋“œ

2022. 10. 9. 20:14
728x90

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {

            Array myArr1 = Array.CreateInstance(typeof(int),10);
            Console.Write($"myArr1.GetLowerBound(0) : {myArr1.GetLowerBound(0)}    "); //0
            Console.Write($"myArr1.GetUpperBound(0) : {myArr1.GetUpperBound(0)}    "); //9
            Console.WriteLine();
            for (int i = myArr1.GetLowerBound(0); i <= myArr1.GetUpperBound(0); i++) //<=๋กœ ์จ์•ผํ•จ!
            {
                myArr1.SetValue(i*10,i);
                Console.Write($"    {myArr1.GetValue(i)}    ");
            }
        }
    }
}

์ถœ๋ ฅ

    0        10        20        30        40        50        60        70        80        90
 

Array.CreateInstance ๋ฉ”์„œ๋“œ (System)

Array ํด๋ž˜์Šค์˜ ์ƒˆ ์ธ์Šคํ„ด์Šค๋ฅผ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.

learn.microsoft.com

์ •์˜

Array ํด๋ž˜์Šค์˜ ์ƒˆ ์ธ์Šคํ„ด์Šค๋ฅผ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋ฒ„๋กœ๋“œ

CreateInstance(Type, Int32) ์ง€์ •ํ•œ Type ๋ฐ ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” 1์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
CreateInstance(Type, Int32[]) ์ง€์ •ํ•œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ๋‹ค์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์ฐจ์› ๊ธธ์ด๊ฐ€ 32๋น„ํŠธ ์ •์ˆ˜ ๋ฐฐ์—ด๋กœ ์ง€์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
CreateInstance(Type, Int64[]) ์ง€์ •ํ•œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ๋‹ค์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์ฐจ์› ๊ธธ์ด๊ฐ€ 64๋น„ํŠธ ์ •์ˆ˜ ๋ฐฐ์—ด๋กœ ์ง€์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
CreateInstance(Type, Int32, Int32) 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ์ธ๋ฑ์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ง€์ •๋œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด์˜ 2์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
CreateInstance(Type, Int32[], Int32[]) ์ง€์ •ํ•œ ํ•˜ํ•œ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ง€์ •ํ•œ Array ๋ฐ ์ฐจ์› ๊ธธ์ด์˜ ๋‹ค์ฐจ์› Type ์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
CreateInstance(Type, Int32, Int32, Int32) ์ง€์ •ํ•œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ์‚ผ์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

CreateInstance(Type, Int32)

์ง€์ •ํ•œ Type ๋ฐ ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” 1์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

C#
public static Array CreateInstance (Type elementType, int length);

 

์˜ˆ์ œ

๋‹ค์Œ ์ฝ”๋“œ ์˜ˆ์ œ์—์„œ๋Š” 1์ฐจ์› Array์„ ๋งŒ๋“ค๊ณ  ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

C#
using System;
public class SamplesArray  {

   public static void Main()  {

      // Creates and initializes a one-dimensional Array of type int.
      Array my1DArray=Array.CreateInstance( typeof(int), 5 );
      for ( int i = my1DArray.GetLowerBound(0); i <= my1DArray.GetUpperBound(0); i++ )
         my1DArray.SetValue( i+1, i );

      // Displays the values of the Array.
      Console.WriteLine( "The one-dimensional Array contains the following values:" );
      PrintValues( my1DArray );
   }

   public static void PrintValues( Array myArr )  {
      System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
      int i = 0;
      int cols = myArr.GetLength( myArr.Rank - 1 );
      while ( myEnumerator.MoveNext() )  {
         if ( i < cols )  {
            i++;
         } else  {
            Console.WriteLine();
            i = 1;
         }
         Console.Write( "\t{0}", myEnumerator.Current );
      }
      Console.WriteLine();
   }
}
/*
This code produces the following output.

The one-dimensional Array contains the following values:
    1    2    3    4    5
*/
 

CreateInstance(Type, Int32[])

์ง€์ •ํ•œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ๋‹ค์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์ฐจ์› ๊ธธ์ด๊ฐ€ 32๋น„ํŠธ ์ •์ˆ˜ ๋ฐฐ์—ด๋กœ ์ง€์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

C#
public static Array CreateInstance (Type elementType, params int[] lengths);

 

์˜ˆ์ œ

๋‹ค์Œ ์ฝ”๋“œ ์˜ˆ์ œ์—์„œ๋Š” ๋‹ค์ฐจ์›์„ ๋งŒ๋“ค๊ณ  ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค Array.

C#
using System;
public class SamplesArray3  {

   public static void Main()  {

      // Creates and initializes a multidimensional Array of type string.
      int[] myLengthsArray = new int[4] { 2, 3, 4, 5 };
      Array my4DArray=Array.CreateInstance( typeof(string), myLengthsArray );
      for ( int i = my4DArray.GetLowerBound(0); i <= my4DArray.GetUpperBound(0); i++ )
         for ( int j = my4DArray.GetLowerBound(1); j <= my4DArray.GetUpperBound(1); j++ )
            for ( int k = my4DArray.GetLowerBound(2); k <= my4DArray.GetUpperBound(2); k++ )
               for ( int l = my4DArray.GetLowerBound(3); l <= my4DArray.GetUpperBound(3); l++ )  {
                  int[] myIndicesArray = new int[4] { i, j, k, l };
                  my4DArray.SetValue( Convert.ToString(i) + j + k + l, myIndicesArray );
               }

      // Displays the values of the Array.
      Console.WriteLine( "The four-dimensional Array contains the following values:" );
      PrintValues( my4DArray );
   }

   public static void PrintValues( Array myArr )  {
      System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
      int i = 0;
      int cols = myArr.GetLength( myArr.Rank - 1 );
      while ( myEnumerator.MoveNext() )  {
         if ( i < cols )  {
            i++;
         } else  {
            Console.WriteLine();
            i = 1;
         }
         Console.Write( "\t{0}", myEnumerator.Current );
      }
      Console.WriteLine();
   }
}
/*
This code produces the following output.

The four-dimensional Array contains the following values:
    0000    0001    0002    0003    0004
    0010    0011    0012    0013    0014
    0020    0021    0022    0023    0024
    0030    0031    0032    0033    0034
    0100    0101    0102    0103    0104
    0110    0111    0112    0113    0114
    0120    0121    0122    0123    0124
    0130    0131    0132    0133    0134
    0200    0201    0202    0203    0204
    0210    0211    0212    0213    0214
    0220    0221    0222    0223    0224
    0230    0231    0232    0233    0234
    1000    1001    1002    1003    1004
    1010    1011    1012    1013    1014
    1020    1021    1022    1023    1024
    1030    1031    1032    1033    1034
    1100    1101    1102    1103    1104
    1110    1111    1112    1113    1114
    1120    1121    1122    1123    1124
    1130    1131    1132    1133    1134
    1200    1201    1202    1203    1204
    1210    1211    1212    1213    1214
    1220    1221    1222    1223    1224
    1230    1231    1232    1233    1234
*/

์„ค๋ช…

๋Œ€๋ถ€๋ถ„์˜ ํด๋ž˜์Šค์™€ Array ๋‹ฌ๋ฆฌ ๊ณต์šฉ ์ƒ์„ฑ์ž ๋Œ€์‹  ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•˜์—ฌ CreateInstance ๋Ÿฐํƒ€์ž„์— ๋ฐ”์ธ๋”ฉ๋œ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.

๋ฐฐ์—ด์˜ ์š”์†Œ lengths ์ˆ˜๋Š” ์ƒˆ Array์ฐจ์›์˜ ์ˆ˜์™€ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ฐฐ์—ด์˜ lengths ๊ฐ ์š”์†Œ๋Š” ์ƒˆ Array์ฐจ์›์˜ ๊ธธ์ด๋ฅผ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ฐธ์กฐ ํ˜•์‹ ์š”์†Œ๊ฐ€ .๋กœ null์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๊ฐ’ ํ˜•์‹ ์š”์†Œ๋Š” 0์œผ๋กœ ์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค.

์ด ๋ฉ”์„œ๋“œ๋Š” O(n) ์—ฐ์‚ฐ์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ n ๋ชจ๋“  ๊ฐ’์˜ ๊ณฑ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค lengths.

์ ์šฉ ๋Œ€์ƒ

.NET 7 RC 1 ๋ฐ ๊ธฐํƒ€ ๋ฒ„์ „

CreateInstance(Type, Int64[])

์ง€์ •ํ•œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ๋‹ค์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์ฐจ์› ๊ธธ์ด๊ฐ€ 64๋น„ํŠธ ์ •์ˆ˜ ๋ฐฐ์—ด๋กœ ์ง€์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

C#
public static Array CreateInstance (Type elementType, params long[] lengths);

๋งค๊ฐœ ๋ณ€์ˆ˜

elementType Type

๋งŒ๋“ค Array์˜ Type์ž…๋‹ˆ๋‹ค.

lengths Int64[]

๋งŒ๋“ค Array์˜ ๊ฐ ์ฐจ์› ํฌ๊ธฐ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” 64๋น„ํŠธ ์ •์ˆ˜ ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค. ๋ฐฐ์—ด์˜ ๊ฐ ์ •์ˆ˜๋Š” 0๊ณผ Int32.MaxValue(ํฌํ•จ) ์‚ฌ์ด์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜

Array

์ง€์ •ํ•œ Type ๋ฐ ๊ฐ ์ฐจ์›์— ๋Œ€ํ•ด ์ง€์ •ํ•œ ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ์ƒˆ ๋‹ค์ฐจ์› Array์ž…๋‹ˆ๋‹ค.

์˜ˆ์™ธ

ArgumentNullException

elementType์ด(๊ฐ€) null์ธ ๊ฒฝ์šฐ

๋˜๋Š”

lengths์ด(๊ฐ€) null์ธ ๊ฒฝ์šฐ

ArgumentException

elementType์€ ์œ ํšจํ•œ Type์ด ์•„๋‹™๋‹ˆ๋‹ค.

๋˜๋Š”

lengths ๋ฐฐ์—ด์— 1๊ฐœ ๋ฏธ๋งŒ์˜ ์š”์†Œ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

NotSupportedException

elementType์€ ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด Void๋Š” ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋˜๋Š”

elementType์ด ๊ฐœ๋ฐฉํ˜• ์ œ๋„ค๋ฆญ ํ˜•์‹์ธ ๊ฒฝ์šฐ.

ArgumentOutOfRangeException

๋ชจ๋“  lengths ๊ฐ’์ด 0๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ Int32.MaxValue๋ณด๋‹ค ํฝ๋‹ˆ๋‹ค.

์˜ˆ์ œ

๋‹ค์Œ ์ฝ”๋“œ ์˜ˆ์ œ์—์„œ๋Š” ๋‹ค์ฐจ์›์„ ๋งŒ๋“ค๊ณ  ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค Array.

C#
using System;
public class SamplesArray3  {

   public static void Main()  {

      // Creates and initializes a multidimensional Array of type string.
      int[] myLengthsArray = new int[4] { 2, 3, 4, 5 };
      Array my4DArray=Array.CreateInstance( typeof(string), myLengthsArray );
      for ( int i = my4DArray.GetLowerBound(0); i <= my4DArray.GetUpperBound(0); i++ )
         for ( int j = my4DArray.GetLowerBound(1); j <= my4DArray.GetUpperBound(1); j++ )
            for ( int k = my4DArray.GetLowerBound(2); k <= my4DArray.GetUpperBound(2); k++ )
               for ( int l = my4DArray.GetLowerBound(3); l <= my4DArray.GetUpperBound(3); l++ )  {
                  int[] myIndicesArray = new int[4] { i, j, k, l };
                  my4DArray.SetValue( Convert.ToString(i) + j + k + l, myIndicesArray );
               }

      // Displays the values of the Array.
      Console.WriteLine( "The four-dimensional Array contains the following values:" );
      PrintValues( my4DArray );
   }

   public static void PrintValues( Array myArr )  {
      System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
      int i = 0;
      int cols = myArr.GetLength( myArr.Rank - 1 );
      while ( myEnumerator.MoveNext() )  {
         if ( i < cols )  {
            i++;
         } else  {
            Console.WriteLine();
            i = 1;
         }
         Console.Write( "\t{0}", myEnumerator.Current );
      }
      Console.WriteLine();
   }
}
/*
This code produces the following output.

The four-dimensional Array contains the following values:
    0000    0001    0002    0003    0004
    0010    0011    0012    0013    0014
    0020    0021    0022    0023    0024
    0030    0031    0032    0033    0034
    0100    0101    0102    0103    0104
    0110    0111    0112    0113    0114
    0120    0121    0122    0123    0124
    0130    0131    0132    0133    0134
    0200    0201    0202    0203    0204
    0210    0211    0212    0213    0214
    0220    0221    0222    0223    0224
    0230    0231    0232    0233    0234
    1000    1001    1002    1003    1004
    1010    1011    1012    1013    1014
    1020    1021    1022    1023    1024
    1030    1031    1032    1033    1034
    1100    1101    1102    1103    1104
    1110    1111    1112    1113    1114
    1120    1121    1122    1123    1124
    1130    1131    1132    1133    1134
    1200    1201    1202    1203    1204
    1210    1211    1212    1213    1214
    1220    1221    1222    1223    1224
    1230    1231    1232    1233    1234
*/

์„ค๋ช…

๋Œ€๋ถ€๋ถ„์˜ ํด๋ž˜์Šค์™€ Array ๋‹ฌ๋ฆฌ ๊ณต์šฉ ์ƒ์„ฑ์ž ๋Œ€์‹  ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•˜์—ฌ CreateInstance ๋Ÿฐํƒ€์ž„์— ๋ฐ”์ธ๋”ฉ๋œ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.

๋ฐฐ์—ด์˜ ์š”์†Œ lengths ์ˆ˜๋Š” ์ƒˆ Array์ฐจ์›์˜ ์ˆ˜์™€ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ฐฐ์—ด์˜ lengths ๊ฐ ์š”์†Œ๋Š” ์ƒˆ Array์ฐจ์›์˜ ๊ธธ์ด๋ฅผ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ฐธ์กฐ ํ˜•์‹ ์š”์†Œ๊ฐ€ .๋กœ null์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๊ฐ’ ํ˜•์‹ ์š”์†Œ๋Š” 0์œผ๋กœ ์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค.

์ด ๋ฉ”์„œ๋“œ๋Š” O(n) ์—ฐ์‚ฐ์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ n ๋ชจ๋“  ๊ฐ’์˜ ๊ณฑ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค lengths.

์ ์šฉ ๋Œ€์ƒ

.NET 7 RC 1 ๋ฐ ๊ธฐํƒ€ ๋ฒ„์ „

CreateInstance(Type, Int32, Int32)

0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ์ธ๋ฑ์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ง€์ •๋œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด์˜ 2์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

C#
public static Array CreateInstance (Type elementType, int length1, int length2);

๋งค๊ฐœ ๋ณ€์ˆ˜

elementType Type

๋งŒ๋“ค Array์˜ Type์ž…๋‹ˆ๋‹ค.

length1 Int32

๋งŒ๋“ค Array์˜ ์ฒซ ๋ฒˆ์งธ ์ฐจ์› ํฌ๊ธฐ์ž…๋‹ˆ๋‹ค.

length2 Int32

๋งŒ๋“ค Array์˜ ๋‘ ๋ฒˆ์งธ ์ฐจ์› ํฌ๊ธฐ์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜

Array

0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ์ธ๋ฑ์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋ฉฐ ๊ฐ ์ฐจ์›์ด ์ง€์ •๋œ ๊ธธ์ด๋กœ ๋œ ์ง€์ •๋œ Type์˜ ์ƒˆ๋กœ์šด 2์ฐจ์› Array์ž…๋‹ˆ๋‹ค.

์˜ˆ์™ธ

ArgumentNullException

elementType์ด(๊ฐ€) null์ธ ๊ฒฝ์šฐ

ArgumentException

elementType์€ ์œ ํšจํ•œ Type์ด ์•„๋‹™๋‹ˆ๋‹ค.

NotSupportedException

elementType์€ ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด Void๋Š” ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋˜๋Š”

elementType์ด ๊ฐœ๋ฐฉํ˜• ์ œ๋„ค๋ฆญ ํ˜•์‹์ธ ๊ฒฝ์šฐ.

ArgumentOutOfRangeException

length1๊ฐ€ 0๋ณด๋‹ค ์ž‘์€ ๊ฒฝ์šฐ

๋˜๋Š”

length2๊ฐ€ 0๋ณด๋‹ค ์ž‘์€ ๊ฒฝ์šฐ

์˜ˆ์ œ

๋‹ค์Œ ์ฝ”๋“œ ์˜ˆ์ œ์—์„œ๋Š” 2์ฐจ์› Array์„ ๋งŒ๋“ค๊ณ  ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

C#
using System;
public class SamplesArray1  {

   public static void Main()  {

      // Creates and initializes a two-dimensional Array of type string.
      Array my2DArray=Array.CreateInstance( typeof(string), 2, 3 );
      for ( int i = my2DArray.GetLowerBound(0); i <= my2DArray.GetUpperBound(0); i++ )
         for ( int j = my2DArray.GetLowerBound(1); j <= my2DArray.GetUpperBound(1); j++ )
            my2DArray.SetValue( "abc" + i + j, i, j );

      // Displays the values of the Array.
      Console.WriteLine( "The two-dimensional Array contains the following values:" );
      PrintValues( my2DArray );
   }

   public static void PrintValues( Array myArr )  {
      System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
      int i = 0;
      int cols = myArr.GetLength( myArr.Rank - 1 );
      while ( myEnumerator.MoveNext() )  {
         if ( i < cols )  {
            i++;
         } else  {
            Console.WriteLine();
            i = 1;
         }
         Console.Write( "\t{0}", myEnumerator.Current );
      }
      Console.WriteLine();
   }
}
/*
This code produces the following output.

The two-dimensional Array contains the following values:
    abc00    abc01    abc02
    abc10    abc11    abc12
*/

์„ค๋ช…

๋Œ€๋ถ€๋ถ„์˜ ํด๋ž˜์Šค์™€ Array ๋‹ฌ๋ฆฌ ๊ณต์šฉ ์ƒ์„ฑ์ž ๋Œ€์‹  ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•˜์—ฌ CreateInstance ๋Ÿฐํƒ€์ž„์— ๋ฐ”์ธ๋”ฉ๋œ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ฐธ์กฐ ํ˜•์‹ ์š”์†Œ๊ฐ€ .๋กœ null์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๊ฐ’ ํ˜•์‹ ์š”์†Œ๋Š” 0์œผ๋กœ ์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค.

์ด ๋ฉ”์„œ๋“œ๋Š” O(n) ์—ฐ์‚ฐ์ด๋ฉฐ, ์—ฌ๊ธฐ์„œ ๊ณฑ length1 ์€ ๋‹ค์Œ๊ณผ n ๊ฐ™์Šต๋‹ˆ๋‹คlength2.

F#์—์„œ๋Š” Array2D.zeroCreate ํ•จ์ˆ˜๋ฅผ ๋Œ€์‹  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ ์šฉ ๋Œ€์ƒ

.NET 7 RC 1 ๋ฐ ๊ธฐํƒ€ ๋ฒ„์ „

CreateInstance(Type, Int32[], Int32[])

์ง€์ •ํ•œ ํ•˜ํ•œ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ง€์ •ํ•œ Array ๋ฐ ์ฐจ์› ๊ธธ์ด์˜ ๋‹ค์ฐจ์› Type ์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

C#
public static Array CreateInstance (Type elementType, int[] lengths, int[] lowerBounds);

๋งค๊ฐœ ๋ณ€์ˆ˜

elementType Type

๋งŒ๋“ค Array์˜ Type์ž…๋‹ˆ๋‹ค.

lengths Int32[]

๋งŒ๋“ค Array ์˜ ๊ฐ ์ฐจ์› ํฌ๊ธฐ๋ฅผ ํฌํ•จํ•˜๋Š” 1์ฐจ์› ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.

lowerBounds Int32[]

๋งŒ๋“ค Array ์˜ ๊ฐ ์ฐจ์› ํ•˜ํ•œ(์‹œ์ž‘ ์ธ๋ฑ์Šค)์„ ํฌํ•จํ•˜๋Š” 1์ฐจ์› ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜

Array

๊ฐ ์ฐจ์›์— ๋Œ€ํ•ด ์ง€์ •ํ•œ ๊ธธ์ด ๋ฐ ํ•˜ํ•œ์„ ๊ฐ€์ง„ ์ง€์ •ํ•œ Array ์˜ ์ƒˆ ๋‹ค์ฐจ์› Type ์ž…๋‹ˆ๋‹ค.

์˜ˆ์™ธ

ArgumentNullException

elementType์ด(๊ฐ€) null์ธ ๊ฒฝ์šฐ

๋˜๋Š”

lengths์ด(๊ฐ€) null์ธ ๊ฒฝ์šฐ

๋˜๋Š”

lowerBounds์ด(๊ฐ€) null์ธ ๊ฒฝ์šฐ

ArgumentException

elementType์€ ์œ ํšจํ•œ Type์ด ์•„๋‹™๋‹ˆ๋‹ค.

๋˜๋Š”

lengths ๋ฐฐ์—ด์— 1๊ฐœ ๋ฏธ๋งŒ์˜ ์š”์†Œ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋˜๋Š”

lengths์™€ lowerBounds ๋ฐฐ์—ด์— ๋“ค์–ด ์žˆ๋Š” ์š”์†Œ ์ˆ˜๊ฐ€ ๋‹ค๋ฅธ ๊ฒฝ์šฐ

NotSupportedException

elementType์€ ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด Void๋Š” ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋˜๋Š”

elementType์ด ๊ฐœ๋ฐฉํ˜• ์ œ๋„ค๋ฆญ ํ˜•์‹์ธ ๊ฒฝ์šฐ.

ArgumentOutOfRangeException

lengths์˜ ๊ฐ’์ด 0๋ณด๋‹ค ์ž‘์Šต๋‹ˆ๋‹ค.

๋˜๋Š”

lowerBounds ์ฐจ์›์˜ ํ•˜ํ•œ ๋ฐ ๊ธธ์ด ํ•ฉ๊ณ„๊ฐ€ Int32.MaxValue๋ณด๋‹ค ํฌ๋ฉด ๊ฐ’์ด ๋งค์šฐ ํฝ์Šต๋‹ˆ๋‹ค.

์˜ˆ์ œ

๋‹ค์Œ ์ฝ”๋“œ ์˜ˆ์ œ์—์„œ๋Š” ์ง€์ •๋œ ํ•˜ํ•œ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์ฐจ์› Array ์„ ๋งŒ๋“ค๊ณ  ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค.

C#
using System;
public class SamplesArray4  {

   public static void Main()  {

      // Creates and initializes a multidimensional Array of type string.
      int[] myLengthsArray = new int[2] { 3, 5 };
      int[] myBoundsArray = new int[2] { 2, 3 };
      Array myArray=Array.CreateInstance( typeof(string), myLengthsArray, myBoundsArray );
      for ( int i = myArray.GetLowerBound(0); i <= myArray.GetUpperBound(0); i++ )
         for ( int j = myArray.GetLowerBound(1); j <= myArray.GetUpperBound(1); j++ )  {
            int[] myIndicesArray = new int[2] { i, j };
            myArray.SetValue( Convert.ToString(i) + j, myIndicesArray );
         }

      // Displays the lower bounds and the upper bounds of each dimension.
      Console.WriteLine( "Bounds:\tLower\tUpper" );
      for ( int i = 0; i < myArray.Rank; i++ )
         Console.WriteLine( "{0}:\t{1}\t{2}", i, myArray.GetLowerBound(i), myArray.GetUpperBound(i) );

      // Displays the values of the Array.
      Console.WriteLine( "The Array contains the following values:" );
      PrintValues( myArray );
   }

   public static void PrintValues( Array myArr )  {
      System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
      int i = 0;
      int cols = myArr.GetLength( myArr.Rank - 1 );
      while ( myEnumerator.MoveNext() )  {
         if ( i < cols )  {
            i++;
         } else  {
            Console.WriteLine();
            i = 1;
         }
         Console.Write( "\t{0}", myEnumerator.Current );
      }
      Console.WriteLine();
   }
}
/*
This code produces the following output.

Bounds:    Lower    Upper
0:    2    4
1:    3    7
The Array contains the following values:
    23    24    25    26    27
    33    34    35    36    37
    43    44    45    46    47
*/

์„ค๋ช…

๋Œ€๋ถ€๋ถ„์˜ ํด๋ž˜์Šค์™€ Array ๋‹ฌ๋ฆฌ ๊ณต์šฉ ์ƒ์„ฑ์ž ๋Œ€์‹  ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•˜์—ฌ CreateInstance ๋Ÿฐํƒ€์ž„์— ๋ฐ”์ธ๋”ฉ๋œ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.

lengths ๋ฐฐ์—ด๊ณผ lowerBounds ๋ฐฐ์—ด์˜ ๊ฐœ์ˆ˜๋Š” ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ฐฐ์—ด์˜ ์š”์†Œ lengths ์ˆ˜๋Š” ์ƒˆ Array์ฐจ์›์˜ ์ˆ˜์™€ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋ฐฐ์—ด์˜ lengths ๊ฐ ์š”์†Œ๋Š” ์ƒˆ Array์ฐจ์›์˜ ๊ธธ์ด๋ฅผ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋ฐฐ์—ด์˜ lowerBounds ๊ฐ ์š”์†Œ๋Š” ์ƒˆ Array์ฐจ์›์˜ ํ•˜ํ•œ์„ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ .NET ํด๋ž˜์Šค ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ๋งŽ์€ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋Š” 0์ด ์•„๋‹Œ ํ•˜ํ•œ์„ ์ฒ˜๋ฆฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ฐธ์กฐ ํ˜•์‹ ์š”์†Œ๊ฐ€ .๋กœ null์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๊ฐ’ ํ˜•์‹ ์š”์†Œ๋Š” 0์œผ๋กœ ์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค.

์ด ๋ฉ”์„œ๋“œ๋Š” O(n) ์—ฐ์‚ฐ์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ n ๋ชจ๋“  ๊ฐ’์˜ ๊ณฑ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค lengths.

์ฐธ๊ณ 

๋ชจ๋“  ์–ธ์–ด๊ฐ€ 0์ด ์•„๋‹Œ ํ•˜ํ•œ์ด ์žˆ๋Š” ๋ฐฐ์—ด์„ ์ง€์›ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ ์–ธ์–ด์˜ ๋ฐฐ์—ด ํ˜•์‹์— ๋”ฐ๋ผ Array 0์ด ์•„๋‹Œ ์ธ์Šคํ„ด์Šค๋ฅผ ์บ์ŠคํŒ…ํ•˜์ง€ ๋ชปํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ํ•˜ํ•œ์ด 6์ธ 1์ฐจ์› ์ •์ˆ˜ ๋ฐฐ์—ด์€ C#์˜ int[] ํ˜•์‹์œผ๋กœ ์บ์ŠคํŒ…ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. InvalidCastException ๊ทธ๋Ÿฌ๋ฉด ๋Ÿฐํƒ€์ž„ ์ค‘์— "'System.Int32[]' ํ˜•์‹์˜ ๊ฐœ์ฒด๋ฅผ 'System.Int32[*]' ํ˜•์‹์œผ๋กœ ์บ์ŠคํŒ…ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."๋ผ๋Š” ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ๋ณ„ํ‘œ(*)๋Š” 0์ด ์•„๋‹Œ ์ธ๋ฑ์Šค๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์–ธ์–ด์˜ ๋ฐฐ์—ด๋กœ ๋งŒ๋“  CreateInstance(Type, Int32[], Int32[]) ๋ชจ๋“  ์ˆœ์œ„์˜ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ๋ฐฐ์—ด์„ ์บ์ŠคํŒ…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์ด ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋งŒ๋“  2์ฐจ์› 0 ๊ธฐ๋ฐ˜ ์ •์ˆ˜ ๋ฐฐ์—ด์„ C#์˜ int[,] ํ˜•์‹์œผ๋กœ ์บ์ŠคํŒ…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ ์šฉ ๋Œ€์ƒ

.NET 7 RC 1 ๋ฐ ๊ธฐํƒ€ ๋ฒ„์ „

CreateInstance(Type, Int32, Int32, Int32)

์ง€์ •ํ•œ Type ๋ฐ ์ฐจ์› ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ธ๋ฑ์Šค๊ฐ€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” ์‚ผ์ฐจ์› Array๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

C#
public static Array CreateInstance (Type elementType, int length1, int length2, int length3);

 

์˜ˆ์ œ

๋‹ค์Œ ์ฝ”๋“œ ์˜ˆ์ œ์—์„œ๋Š” 3์ฐจ์› Array์„ ๋งŒ๋“ค๊ณ  ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

C#
using System;
public class SamplesArray2  {

   public static void Main()  {

      // Creates and initializes a three-dimensional Array of type Object.
      Array my3DArray=Array.CreateInstance( typeof(Object), 2, 3, 4 );
      for ( int i = my3DArray.GetLowerBound(0); i <= my3DArray.GetUpperBound(0); i++ )
         for ( int j = my3DArray.GetLowerBound(1); j <= my3DArray.GetUpperBound(1); j++ )
            for ( int k = my3DArray.GetLowerBound(2); k <= my3DArray.GetUpperBound(2); k++ )
               my3DArray.SetValue( "abc" + i + j + k, i, j, k );

      // Displays the values of the Array.
      Console.WriteLine( "The three-dimensional Array contains the following values:" );
      PrintValues( my3DArray );
   }

   public static void PrintValues( Array myArr )  {
      System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
      int i = 0;
      int cols = myArr.GetLength( myArr.Rank - 1 );
      while ( myEnumerator.MoveNext() )  {
         if ( i < cols )  {
            i++;
         } else  {
            Console.WriteLine();
            i = 1;
         }
         Console.Write( "\t{0}", myEnumerator.Current );
      }
      Console.WriteLine();
   }
}
/*
This code produces the following output.

The three-dimensional Array contains the following values:
    abc000    abc001    abc002    abc003
    abc010    abc011    abc012    abc013
    abc020    abc021    abc022    abc023
    abc100    abc101    abc102    abc103
    abc110    abc111    abc112    abc113
    abc120    abc121    abc122    abc123
*/

์„ค๋ช…

๋Œ€๋ถ€๋ถ„์˜ ํด๋ž˜์Šค์™€ Array ๋‹ฌ๋ฆฌ, ๋Ÿฐํƒ€์ž„์— CreateInstance ๋ฐ”์ธ๋”ฉ๋œ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๊ณต์šฉ ์ƒ์„ฑ์ž ๋Œ€์‹  ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

์ฐธ์กฐ ํ˜•์‹ ์š”์†Œ๊ฐ€ .๋กœ null์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๊ฐ’ ํ˜•์‹ ์š”์†Œ๋Š” 0์œผ๋กœ ์ดˆ๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค.

This method is an O(n) operation, where n is the product of length1, length2, and length3.

F#์—์„œ Array3D.zeroCreate ํ•จ์ˆ˜๋ฅผ ๋Œ€์‹  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

728x90

'C# > C#' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[C#] ์ •์ˆ˜ ์ˆซ์ž ํ˜•์‹  (0) 2022.06.11
ํด๋ž˜์Šค๋ฅผ ๋ฐฐ์—ด๋กœ ์„ ์–ธํ•˜๊ธฐ  (0) 2022.02.24
ํ•„๋“œ, ๋ฉค๋ฒ„, ์ง€์—ญ๋ณ€์ˆ˜, ์ •์ ํ•„๋“œ, ์ •์  ๋ฉ”์†Œ๋“œ ๊ฐœ๋… ์ •๋ฆฌ  (0) 2022.02.14
[C#]๋ฌธ์ž์—ด ์ถœ๋ ฅ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ๋ฒ•  (0) 2022.02.04
[C# ์ฝ˜์†”] 5x5 ๋™๊ทธ๋ผ๋ฏธํŒ ์ถœ๋ ฅ  (0) 2022.02.02
    'C#/C#' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
    • [C#] ์ •์ˆ˜ ์ˆซ์ž ํ˜•์‹
    • ํด๋ž˜์Šค๋ฅผ ๋ฐฐ์—ด๋กœ ์„ ์–ธํ•˜๊ธฐ
    • ํ•„๋“œ, ๋ฉค๋ฒ„, ์ง€์—ญ๋ณ€์ˆ˜, ์ •์ ํ•„๋“œ, ์ •์  ๋ฉ”์†Œ๋“œ ๊ฐœ๋… ์ •๋ฆฌ
    • [C#]๋ฌธ์ž์—ด ์ถœ๋ ฅ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ๋ฒ•
    Rainbow๐ŸŒˆCoder
    Rainbow๐ŸŒˆCoder
    ๋ชฐ๋ผ๋„ ๊ฒฐ๊ตญ์€ ์•„๋Š” ๊ฐœ๋ฐœ์ž, ๊ทธ๋Ÿฐ ์‚ฌ๋žŒ์ด ๋˜๊ธฐ ์œ„ํ•œ ๋งค์ผ์˜ ํ•œ๊ฑธ์Œ

    ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”