1/*
2 Copyright(C) 1998
3 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4
5 Permission to use, copy, modify, and distribute this
6 software and its documentation for EDUCATIONAL purposes
7 and without fee is hereby granted provided that this
8 copyright notice appears in all copies.
9
10 date : January 1, 1998.
11 authorĀ : Salih Yurttas.
12
13 a_04.cpp
14*/
15
16
17#include <iostream>
18#include <vector>
19
20using namespace std;
21
22#include "A.h"
23
24const int N=4;
25
26int main(int argc, char* argv[]) {
27
28 A a1;
29
30 cout << "initial values after default construction-A() /";
31 cout << endl;
32
33 cout << a1.get_i1();
34 cout << endl;
35 cout << a1.get_i2();
36 cout << endl;
37
38 A a2[] = {a1,
39 A(),
40 A(7),
41 A()};
42
43 vector<A> v2(a2,
44 a2+4);
45
46 cout << "initial values after construction-v2 /";
47 cout << endl;
48
49 for(int i=0; i<N; i++)
50 cout << v2[i] << endl;
51
52 a1.set_i1(4);
53 a1.set_i2(6);
54
55 cout << "updated values - a1 /";
56 cout << endl;
57
58 cout << a1;
59 cout << endl;
60
61 v2[0].set_i1_i2(3);
62
63 v2[1].set_i1_i2(1,
64 7);
65
66 v2[2].set_i1_i2(2,
67 2);
68
69 v2[3].set_i1_i2(3,
70 1);
71
72 cout << "updated values - v2 /";
73 cout << endl;
74
75 for(int i=0; i<N; i++)
76 cout << v2[i] << endl;
77
78}