Yurttas/PL/OOL/Cplusplus/F/03/02/01/00/06/s 00.cpp

 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   s_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "S.h"
22
23int main(int argc, char* argv[]) {
24
25  S s_0("Apple");
26
27  cout << "initial values after default construction-S() /" << endl;
28  cout << "s_0 : ";
29  cout << s_0 << endl;
30  cout << endl;
31
32  S s_1;
33
34  s_1 = s_0;
35
36  cout << "after s_1=s_0 /" << endl;
37  cout << "s_1 : ";
38  cout << s_1 << endl;
39  cout << endl;
40
41  cout << "after s_1=s_0 /" << endl;
42  cout << "s_0 : ";
43  cout << s_0 << endl;
44  cout << endl;
45
46  S s_2("Orange");
47
48  S s_3("Orange");
49
50  s_2 = s_3;
51
52  cout << "after s_2=s_3 /" << endl;
53  cout << "s_2 : ";
54  cout << s_2 << endl;
55  cout << endl;
56
57  cout << "after s_2=s_3 /" << endl;
58  cout << "s_3 : ";
59  cout << s_3 << endl;
60  cout << endl;
61
62  s_3 = s_1;
63
64  cout << "after s_3=s_1 /" << endl;
65  cout << "s_3 : ";
66  cout << s_3 << endl;
67  cout << endl;
68
69  cout << "after s_3=s_1 /" << endl;
70  cout << "s_1 : ";
71  cout << s_1 << endl;
72  cout << endl;
73
74}