Yurttas/PL/OOL/Cplusplus/F/05/01/03/00/i v 00.cpp

Revision as of 22:42, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line start="1" enclose="div">/* Copyright(C) 1998 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. Perm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 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   i_v_00.cpp
14*/
15
16
17#include <iostream>
18#include <vector>
19
20using namespace std;
21
22#include "I_V.h"
23
24int main(int argc, char* argv[]) {
25
26  I_V a_0;
27
28  cout << "a_0 values after construction-I_V() /" << endl;
29  cout << a_0 << endl;
30  cout << endl;
31
32  a_0.set_d(2);
33
34  cout << "a_0 values after a_0.set_d(2) /" << endl;
35  cout << a_0 << endl;
36  cout << endl;
37
38  a_0.set_d(4);
39
40  a_0.set_d(0,
41            3);
42
43  a_0.set_d(3,
44            9);
45
46  int n = a_0.get_size();
47
48  vector<int> aa = a_0.get_d();
49
50  cout << "aa after a_0.get_d() /" << endl;
51  for(int i=0; i<n; i++)
52    cout << aa.at(i) << endl;
53
54  cout << endl;
55
56  I_V a_1(a_0);
57
58  cout << "a_1 values after construction-I_V(const I_V&) /" << endl;
59  cout << a_1 << endl;
60  cout << endl;
61
62  a_1.set_d(3,
63            7);
64
65  cout << "a_1 after updated by (3,7) /" << endl;
66  cout << a_1 << endl;
67  cout << endl;
68
69  a_1 = a_0;
70
71  cout << "a_1 after a_1=a_0 /" << endl;
72  cout << a_1 << endl;
73  cout << endl;
74
75  cout << "a_0 after a_1=a_0 /" << endl;
76  cout << a_0 << endl;
77  cout << endl;
78
79}