This is an excerpt of some c++ code, that i'll have to explain in detail in some days:
std::vector<int> vct(8, 5);
std::generate(vct.begin(), vct.end(), &rand);
std::copy(vct.rbegin(), vct.rend(),
std::ostream_iterator<int>(std::cout, "\n"));
i think i understand everything about it, except that tiny mystical &rand. what exactly does it do? i mean obviously it produces some kind of pseudo-random-numbers, but they always remain the same. where does the &rand come from? what kind of expression is it? where do the values it produces come from? i'm a bit confused…
also, i could neither find any other occurrences of the word "rand" in the code, nor did i see any code that could have something to do with random numbers. that made me wonder, because my (very limited) experience in c++ showed, that only very few things simply work without having to be declared or included previously.
thanks for helping out!