Yurttas/PL/OOL/Cplusplus/F/03/01/04/00/a 00.cpp

From ZCubes Wiki
Revision as of 22:03, 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)
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   a_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "A.h"
22
23int main(int argc, char* argv[]) {
24
25  A a_0;
26
27  cout << "initial values after default construction-A() /" << endl;
28  cout << a_0 << endl;
29  cout << endl;
30
31  cout << "private k value after default construction-A() /" << endl;
32  cout << endl;
33  cout << a_0.get_k() << endl;
34  cout << endl;
35
36  A a_1(2);
37
38  cout << "initial values after construction-A(int) /" << endl;
39  cout << a_1 << endl;
40  cout << endl;
41
42  cout << "private k value after construction-A(int) /" << endl;
43  cout << endl;
44  cout << a_1.get_k() << endl;
45  cout << endl;
46
47  A a_2(a_1);
48
49  cout << "initial values after construction-A(A&) /" << endl;
50  cout << a_2 << endl;
51  cout << endl;
52
53  cout << "initial values after construction-A(A&) /" << endl;
54  cout << a_1 << endl;
55  cout << endl;
56
57  a_0 = a_1;
58
59  cout << "values after assignment(=) /" << endl;
60  cout << a_0 << endl;
61  cout << endl;
62
63  cout << "values after assignment(=) /" << endl;
64  cout << a_1 << endl;
65  cout << endl;
66
67}