Yurttas/PL/OOL/Cplusplus/F/03/01/01/04/B.cpp

From ZCubes Wiki
Revision as of 22:53, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line start="1" enclose="div">/* Copyright(C) 2002 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) 2002
 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, 2002.
11   author : Salih Yurttas.
12
13   B.cpp
14*/
15
16
17#include "B.h"
18
19B::
20B(const int a,
21  const int b) : i0(a),
22                 i1(b) {
23}
24
25B::
26B(const B& a) : i0(a.i0),
27                i1(a.i1) {
28}
29
30B&
31B::
32operator=(const B& a) {
33  if(this==&a) return *this;
34
35  i0 = a.i0;
36  i1 = a.i1;
37
38  return *this;
39}
40
41int
42B::
43get_i0() const {
44  return i0;
45}
46
47int
48B::
49get_i1() const {
50  return ++i1;
51}
52
53void
54B::
55set_i0(const int a) {
56  i0 = a;
57}
58
59void
60B::
61set_i1(const int a) {
62  i1 = a;
63}
64
65ostream&
66operator<<(ostream& os,
67           const B& b) {
68  os << b.i0 << endl;
69  os << b.i1 << endl;
70  os << endl;
71
72  return os;
73}