Hi All
Sorry, python programmer so the nuances of C++ are still new to me. Quick question about pointers. in particular. In the following code buffer is set as a pointer [1] to what I assume is the start sample of the output channel buffer.
// Get a pointer to the start sample in the buffer for this audio output channel
auto* buffer = bufferToFill.buffer->getWritePointer (channel, bufferToFill.startSample); //[1]
// Fill the required number of samples with noise between -0.125 and +0.125
for (auto sample = 0; sample < bufferToFill.numSamples; ++sample)
buffer[sample] = random.nextFloat() * 0.25f - 0.125f; //[2]
I understand that to be an address but, why don’t I have to dereference it later [2]?
I would have expected that line to look like :
*(buffer+sample) = random.nextFloat() * 0.25f - 0.125f; //[2]
I am only new some simple explanation would be great
Thanks
Gav