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

This C# program calculates and displays an upper triangular matrix based on user input. Problem Statement: The program takes the...
This C# program serves as a demonstration of bitwise operators, which are fundamental operators used for manipulating individual bits in...
This C# program is designed to interchange or swap the columns of a matrix. A matrix is a two-dimensional array...