Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error CS0244 

Error Message

Neither "is" nor "as" are valid on pointer types

The is and as keywords are not valid for use on pointer types. For more information, see Unsafe Code and Pointers (C# Programming Guide).

The following sample generates CS0244:

// CS0244.cs
// compile with: /unsafe

class UnsafeTest
{
   unsafe static void SquarePtrParam (int* p)
   {
      bool b = p is object;   // CS0244 p is pointer
   }

   unsafe public static void Main()
   {
      int i = 5;
      SquarePtrParam (&i);
   }
}

Community Additions

ADD
Show:
© 2015 Microsoft