Yurttas/PL/OOL/Cplusplus/F/04/02/01/00/P.cpp

From ZCubes Wiki
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   P.cpp
14*/
15
16
17#include "P.h"
18
19P::
20P(const int i) : i1(i) {
21}
22
23P::
24P(const P& o) : i1(o.i1) {
25}
26
27P&
28P::
29operator=(const P& o) {
30  if(this==&o) return *this;
31
32  i1 = o.i1;
33
34  return *this;
35}
36
37P::
38~P() {
39}
40
41int
42P::
43get_i1() const {
44  return i1;
45}
46
47void
48P::
49set_i1(const int i) {
50  i1 = i;
51}
52
53ostream&
54operator<<(ostream& os,
55           const P& o) {
56  os << "P type :" << endl;
57  os << o.i1 << endl;
58  os << endl;
59
60  return os;
61}