Share via


컴파일러 오류 CS0036

업데이트: 2007년 11월

오류 메시지

out 매개 변수에는 '[In]' 특성을 사용할 수 없습니다.
An out parameter cannot have the '[In]' attribute

일반적으로 In 특성은 out 매개 변수에 사용할 수 없습니다.

다음 샘플에서는 CS0036 오류가 발생하는 경우를 보여 줍니다.

// CS0036.cs

using System;
using System.Runtime.InteropServices;

public class MyClass
{
   public static void TestOut([In] out char TestChar)   // CS0036
   // try the following line instead
   // public static void TestOut(out char TestChar)
   {
      TestChar = 'b';
      Console.WriteLine(TestChar);
   }

   public static void Main()
   {
      char i;           //variable to receive the value
      TestOut(out i);   // the arg must be passed as out
      Console.WriteLine(i);
   }
}