Copying a std::array
easyQuestion 534The 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, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
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.