'Is there a way, to conditionally allocate some fixed-size-stack buffer?

pretty much tittle!

imagine this here:

public unsafe ConditionalAllocOnStack
{
    private fixed byte STACK[CONDITION_TRUE ? 100 : 0];

    public ConditionalAllocOnStack()
    {
         //....
    }     
}

Anyway to make this possible, with the managed ways or unmanged/unsafe ways.

Would be neat to know this, and a little appele:

Pls, I respect all opionions and think critically on them, even if some1 say "i would not do what u doing " and so on.. But pls just for the sake of curiosity I would love to know if such constructs are possible :)

Thx



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source