我最近接触到了C++中的关键字auto。
在以下代码中:
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; });
这涉及对音频流进行频率分析。 从这个网站上获取:http://katyscode.wordpress.com/2013/01/16/cutting-your-teeth-on-fmod-part-4-frequency-analysis-graphic-equalizer-beat-detection-and-bpm-estimation/ 我已经在论坛中搜索,但是它说关键字没有用。有人能解释一下这里的用途吗?
我对c ++比较新,请尽量不要让答案太复杂。
谢谢大家。
自动将maxIterator指针化了吗?