Yurttas/PL/OOL/Cplusplus/F/05/01/03/02/t v 01.cpp
Jump to navigation
Jump to search
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 t_v_01.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "T_V.cpp"
22
23int main(int argc, char* argv[]) {
24
25 T_V<double> a_0;
26
27 cout << "a_0 values after construction-T_V() /" << endl;
28 cout << a_0 << endl;
29 cout << endl;
30
31 a_0.set_d(2);
32
33 cout << "a_0 values after a_0.set_d(2) /" << endl;
34 cout << a_0 << endl;
35 cout << endl;
36
37 a_0.set_d(4);
38
39 a_0.set_d(0,
40 3);
41
42 a_0.set_d(3,
43 9);
44
45 int n = a_0.get_size();
46
47 vector<double> aa = a_0.get_d();
48
49 cout << "aa after a_0.get_d() /" << endl;
50 for(int i=0; i<n; i++)
51 cout << aa.at(i) << endl;
52
53 cout << endl;
54
55 T_V<double> a_1(a_0);
56
57 cout << "a_1 values after construction-T_V(const T_V&) /" << endl;
58 cout << a_1 << endl;
59 cout << endl;
60
61 a_1.set_d(3,
62 7);
63
64 cout << "a_1 after updated by (3,7) /" << endl;
65 cout << a_1 << endl;
66 cout << endl;
67
68 a_1 = a_0;
69
70 cout << "a_1 after a_1=a_0 /" << endl;
71 cout << a_1 << endl;
72 cout << endl;
73
74 cout << "a_0 after a_1=a_0 /" << endl;
75 cout << a_0 << endl;
76 cout << endl;
77
78}