You are taking quiz cppquiz.org/q/tn9ya. After 0 of 10 questions, you have 0.00 points.

Question #140 Difficulty: 2

According to the C++17 standard, what is the output of this program?

    #include <iostream>
using namespace std;

size_t get_size_1(int* arr)
{
  return sizeof arr;
}

size_t get_size_2(int arr[])
{
  return sizeof arr;
}

size_t get_size_3(int (&arr)[10])
{
  return sizeof arr;
}

int main()
{
  int array[10];
  //Assume sizeof(int*) != sizeof(int[10])
  cout << (sizeof(array) == get_size_1(array));
  cout << (sizeof(array) == get_size_2(array));
  cout << (sizeof(array) == get_size_3(array));
}

Answer:

Want a hint? (It will reduce the max score for this question from 1 to 0.5)

Mode : Quiz

If you want to quit the current quiz and go back to training mode, click here.