Compiler Error CS1641
A fixed size buffer field must have the array size specifier after the field name
Unlike regular arrays, fixed size buffers require a constant size to be specified at the declaration point. To resolve this error, add a positive integer literal or a constant positive integer and put the square brackets after the identifier.
The following sample generates CS1641:
// CS1641.cs
// compile with: /unsafe /target:library
unsafe struct S {
fixed int [] a; // CS1641
// OK
fixed int b [10];
const int c = 10;
fixed int d [c];
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: