CJCoding With Joseph
15free / daySign inCreate account

Copying a std::array

The code already creates array<int, 3> a = {1, 2, 3};, copies it with array<int, 3> b = a;, and then changes b[0] to 99.

Print two lines: the text a[0]:, a space and the first element of a, then the text b[0]:, a space and the first element of b.

Expected Output:

a[0]: 1
b[0]: 99

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
STL Containersstd::array
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.