What would be the output of this code?

Advertisement

There are 2 different answer option(s) of this question, please select the right option(s).

int32_t nums[3]={2,4,3};
std::cout << ( nums[0] << nums[1] << nums[2] );

  • The output is the addresses of nums[0], nums[1], and nums[2], in that order, with no spaces.
  • 256
  • 0
  • 243

or

int i0=4, i1=6, i2=8;
int& nums[3]={i2,i0,i1};
std::cout<<nums[0]<<nums[1]<<nums[2];

  • There is no output. The code causes a compiler error because nums is an array of references, which is illegal.
  • 846
  • The output is the addresses of i2, i0, and i1, in that order, with no spaces.
  • 468
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend