Examveda

What will be the output of the following C++ code?
#include <iostream>
#include <array>
using namespace std;
int main(int argc, char const *argv[])
{
	array<int,10> arr = {1,2,3,4,5};
	cout<<"size:"<<arr.size()<<endl;
	cout<<"maxsize:"<<arr.max_size()<<endl;
	return 0;
}

A. size:10
maxsize:10

B. size:5
maxsize:10

C. size:5
maxsize:5

D. size:10
maxsize:5

Answer: Option A


Join The Discussion

Related Questions on C plus plus miscellaneous

What is the difference between '++i' and 'i++' in C++?

A. None of the above

B. They both have the same effect

C. '++i' increments the value of 'i' before returning it, while 'i++' increments the value of 'i' after returning it

D. '++i' increments the value of 'i' after returning it, while 'i++' increments the value of 'i' before returning it