Cascading first order digital filters in C++ In a related question a probable solution was given to build a first-order digital filter and then cascade three of them in order to turn white noise into pink.  I have applied the C++ as follows but still the signal sounds and looks like white noise.
I would like to know what is wrong with my implementation and why I don't hear pink noise.  For reference, the poles and zeros come from Robert Bristow-Johnson's work here.
Header:
float *state = nullptr;
Implementation:
state = new float[0.0]; in Constructor.
Then in the loop, for (int i=0; i &lt; numSamples; i++)
float first = first_order_filter(whiteNoise, 0.99572754, 0.98443604, state);
float second = first_order_filter(first, 0.94790649, 0.83392334, state);
float third = first_order_filter(second, 0.53567505, 0.07568359, state);
out1 = third;

Where first_order_filter is defined as in Robert's answer here:
https://dsp.stackexchange.com/a/70963/11391
I would love to know if this code is approximately correct/ where the problem lies.
My late night brain made foolish mistakes, for the record, if anyone needs this, the working code is as follows:
Header:
float state1;
float state2;
float state3;

Implementation:
In Constructor:
state1 = 0;
state2 = 0;
state3 = 0;

Robert's function:
// this processes one sample

float first_order_filter(float input, float pole, float zero, float *state)
{
    float new_state = input + pole*(*state);
    float output = new_state - zero*(*state);
    *state = new_state;
    return output;
}

Then in the loop, for (int i=0; i &lt; numSamples; i++)
float first = first_order_filter(whiteNoise, 0.99572754, 0.98443604, &amp;state1);
float second = first_order_filter(first, 0.94790649, 0.83392334, &amp;state2);
float third = first_order_filter(second, 0.53567505, 0.07568359, &amp;state3);
out1 = third;

Of course this works like a charm, producing Pink Noise and if the poles and zeros are swapped it produces Blue/ Azure Noise.