Yurttas/PL/OOL/Cplusplus/F/03/01/02/00/c 00.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 c_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "C.h"
22
23int main(int argc, char* argv[]) {
24
25 C c_0;
26
27 cout << "initial values after construction-C(int) /" << endl;
28 cout << c_0 << endl;
29 cout << endl;
30
31 int* aa = new int[N];
32
33 aa = c_0.get_d();
34
35 cout << "aa after c_0.get_d() /" << endl;
36 for(int i=0; i<N; ++i)
37 cout << aa[i] << endl;
38
39 cout << endl;
40
41 c_0.set_d(9);
42
43 cout << "c_0 after updated by (9) /" << endl;
44 cout << c_0 << endl;
45 cout << endl;
46
47 C c_1(c_0);
48
49 cout << "initial values after construction-C(C&) /" << endl;
50 cout << c_1 << endl;
51 cout << endl;
52
53 c_1.set_d(3,7);
54
55 cout << "c_1 after updated by (3,7) /" << endl;
56 cout << c_1 << endl;
57 cout << endl;
58
59 c_1.set_d(aa);
60
61 cout << "c_1 after updated by (aa) /" << endl;
62 cout << c_1 << endl;
63 cout << endl;
64
65 c_1 = c_0;
66
67 cout << "c_1 after c_1=c_0 /" << endl;
68 cout << c_1 << endl;
69 cout << endl;
70
71 cout << "c_0 after c_1=c_0 /" << endl;
72 cout << c_0 << endl;
73 cout << endl;
74
75}