C++ Institute CPP Question Answer
What happens when you attempt to compile and run the following code?
#include
#include
#include
#include
using namespace std;
void myfunction(int i) {
cout << " " << i;
}
int main() {
vector
fill(v1.begin()+2, v1.end()?2,2);
fill_n(v1.begin()+4,2,3);
for_each(v1.begin(), v1.end(), myfunction);
return 0;
}
Program outputs: