X
X
Xasthul2017-08-23 20:17:56
C++ / C#
Xasthul, 2017-08-23 20:17:56

How to display the entire contents of an array?

It is necessary to display the total_1 array on the screen.
cout << total_1
It does not work. Help me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
longclaps, 2017-08-23
@Xasthul

The construction cout << блаблаworks with elementary types, the array is not.
Display the contents of the array in a loop.

A
Anton Zhilin, 2017-08-23
@Anton3

With this lib:

fmt::print("Total: [{}]\n", fmt::join(total_1.begin(), total_1.end(), ", "));
//=> Total: [1, 2, 3]
Maybe someone else will go over to the printf-style side :]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question