What will happen as a result of compiling this code? (C ++ 11)
#include <iostream>
#include <array>
using namespace std;


int main()
{
    array<int> a{1, 2, 3, 4, 5};
    for(auto& rit: a)
        ++rit;
    for(auto rit: a)
        cout << rit;
}
Explanation
The size of the array container must be specified explicitly as the 2nd parameter of the template array<type, size>

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes