I recently came accross the keyword auto in c++.
In the code:
auto maxIterator = std::max_element(&spec[0], &spec[sampleSize]);
float maxVol = *maxIterator;
// Normalize
if (maxVol != 0)
std::transform(&spec[0], &spec[sampleSize], &spec[0], [maxVol] (float dB) -> float { return dB / maxVol; });
This is to do with running a frequency analysis on a audio stream. From the website: http://katyscode.wordpress.com/2013/01/16/cutting-your-teeth-on-fmod-part-4-frequency-analysis-graphic-equalizer-beat-detection-and-bpm-estimation/
I have searched the forums but It says that there is no use for the keyword. Could someone please explain the use of it here.
I am quite new to c++ so please try not to make the answers too complicated. Thanks so much all.
Did auto make maxIterator a pointer also?