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

62 views Asked by At

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

0

There are 0 answers