数组的替代品VECTOR

#include "stdafx.h"
#include
#include
#include

int main()
{

    using namespace std;
	double a1[4] = {1.2, 2.4, 3.6, 4.8 };
	vector a2(4);
	a2[0] = 1.0/3.0;
	a2[1] = 1.0/5.0;
	a2[2] = 1.0/7.0;
	a2[3] = 1.0/9.0;

	array a3 = {3.14, 2.72, 1.62, 1.41};
	array a4;
	a4 = a3;

	cout<<"a1[2]: "<

你可能感兴趣的:(C/C++)