Skip to content

Instantly share code, notes, and snippets.

@kevingosse
Created September 19, 2025 16:51
Show Gist options
  • Save kevingosse/ef8461ecfe5cd0241cf79b447d91b55f to your computer and use it in GitHub Desktop.
Save kevingosse/ef8461ecfe5cd0241cf79b447d91b55f to your computer and use it in GitHub Desktop.
namespace ConsoleApp1;
internal unsafe class Program
{
private struct StructWithFixedBuffer
{
public StructWithFixedBuffer()
{
}
public fixed long buffer[1];
}
public static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
var a = new StructWithFixedBuffer();
Console.WriteLine($"{a.buffer[0]} ");
a.buffer[0]++;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment