C# Error CS1663 – Fixed size buffer type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double

C# Error

CS1663 – Fixed size buffer type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double

Reason for the Error & Solution

Fixed size buffer type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double

A fixed sized buffer may not be any type other than those listed. To avoid this error, use another type or do not use a fixed array.

Example

The following sample generates CS1663.

// CS1663.cs  
// compile with: /unsafe /target:library  
  
unsafe struct C  
{  
   fixed string ab[10];   // CS1663  
}  

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...