Answer to Question #325099 in C++ for nickname

Question #325099

Observe the following code:

 

int nums[3] = {1, 2, 3};

std::cout << nums;

 

What will be output to the screen?


A: 1.

B: 3.

C: 123.

D: A memory address.


1
Expert's answer
2022-04-08T09:01:42-0400
#include <iostream>

using namespace std;

int main()
{
	int nums[3] = { 1, 2, 3 };
	std::cout << nums<<endl;
	//result is D: A memory address
	//because of output nums == output &nums[0]
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS