Cant cout an array

Hi I've made the array cs1 to be equal to array cs.
But I cant get the output. The compiler tells that there is a problem at this line: cout << cs; So what is the problem? Thank you!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "stdafx.h"
#include <iostream>
#include <cstdlib> 
#include <cmath>
#include <array>
using namespace std;

int main()
{
	int j;
	array<double,4> cs1 = { 0.1, 0.1, 0.4, 0.2 };
	array<double, 4> cs;
	cin >> j;
	if (j == 1) {
		cs=cs1;
	};
	cout << cs;
	system("pause\n");
	return 0;
}
1
2
3
4
5
6
7
8
9
10
#include <iostream>

int main() {

    const int array[] = { 12, 45, 67, 28, 92, 37, 19, 64 } ;

    // for each int value in the array, print it out
    for( int value : array ) std::cout << value << ' ' ;
    std::cout << '\n' ;
}

http://coliru.stacked-crooked.com/a/a52d9503a4a15aa9
1
2
3
4
5
6
7
8
9
10
#include <iostream>

int main() {

    const int array[] = { 12, 45, 67, 28, 92, 37, 19, 64 } ;

    // for each int value in the array, print it out
    for( int value : array ) std::cout << value << ' ' ;
    std::cout << '\n' ;
}

http://coliru.stacked-crooked.com/a/a52d9503a4a15aa9
Topic archived. No new replies allowed.