-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFixed.cpp
More file actions
38 lines (32 loc) · 756 Bytes
/
Fixed.cpp
File metadata and controls
38 lines (32 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "Fixed.hpp"
#include <iostream>
Fixed::Fixed () : integer (0)
{
std::cout << "Dafault constructor called" << std::endl;
}
Fixed &
Fixed::operator= (const Fixed &object)
{
std::cout << "Copy assigment operator called" << std::endl;
if (this != &object)
integer = object.getRawBits ();
return *this;
}
Fixed::Fixed (const Fixed &object)
{
std::cout << "Copy constructor called" << std::endl;
*this = object;
}
Fixed::~Fixed () { std::cout << "Destructor called" << std::endl; }
int
Fixed::getRawBits (void) const
{
std::cout << "getRawBits member function called" << std::endl;
return integer;
}
void
Fixed::setRawBits (const int bits)
{
std::cout << "setRawBits member function called" << std::endl;
integer = bits;
}