Yurttas/PL/OOL/Cplusplus/F/05/01/02/00/i a 00.cpp

Revision as of 22:39, 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_a_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "I_A.h"
22
23int main(int argc, char* argv[]) {
24
25  I_A a_0;
26
27  cout << "a_0 values after construction-I_A() /" << 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            3);
39
40  cout << "a_0 values after a_0.set_d(4,3) /" << endl;
41  cout << a_0 << endl;
42  cout << endl;
43
44  int n = a_0.get_s();
45
46  int* aa = new int[n];
47
48  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[i] << endl;
53
54  cout << endl;
55
56  I_A a_1(a_0);
57
58  cout << "a_1 values after construction-I_A(const I_A&) /" << 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}