diff options
| author | Dominik Kaiser | 2025-02-13 14:47:48 +0100 |
|---|---|---|
| committer | Dominik Kaiser | 2025-02-13 14:47:48 +0100 |
| commit | b013c2457c45d369c9fc9a854caacdffd414ca25 (patch) | |
| tree | c192fe7a2ef49d33e4587099826d8806ef3a0a39 /ex00/Fixed.cpp | |
| parent | 80234b81fd22f737d3c86f5993745b1c7053a56a (diff) | |
| download | cpp02-b013c2457c45d369c9fc9a854caacdffd414ca25.tar.gz cpp02-b013c2457c45d369c9fc9a854caacdffd414ca25.zip | |
Add main and fix format
Diffstat (limited to 'ex00/Fixed.cpp')
| -rw-r--r-- | ex00/Fixed.cpp | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/ex00/Fixed.cpp b/ex00/Fixed.cpp index 206325d..02b603f 100644 --- a/ex00/Fixed.cpp +++ b/ex00/Fixed.cpp @@ -6,34 +6,43 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/12 17:06:18 by dkaiser #+# #+# */ -/* Updated: 2025/02/13 13:17:58 by dkaiser ### ########.fr */ +/* Updated: 2025/02/13 14:43:55 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ #include "Fixed.hpp" - #include <iostream> -Fixed::Fixed(void) : raw_value(0) { - std::cout << "Default constructor called" << std::endl; +Fixed::Fixed(void) : raw_value(0) +{ + std::cout << "Default constructor called" << std::endl; } -Fixed::Fixed(const Fixed &other) : raw_value(other.getRawBits()) { - std::cout << "Copy constructor called" << std::endl; +Fixed::Fixed(const Fixed &other) : raw_value(other.raw_value) +{ + std::cout << "Copy constructor called" << std::endl; } -Fixed::&operator=(const Fixed &other) { - std::cout << "Copy assignment operator called" << std::endl; - this->raw_value = other.getRawBits(); +Fixed &Fixed::operator=(const Fixed &other) +{ + std::cout << "Copy assignment operator called" << std::endl; + this->raw_value = other.getRawBits(); + return *this; } -Fixed::~Fixed(void) { std::cout << "Destructor called" << std::endl; } +Fixed::~Fixed(void) +{ + std::cout << "Destructor called" << std::endl; +} -int Fixed::getRawBits(void) const { - std::cout << "getRawBits member function called" << std::endl; - return this->raw_value; +int Fixed::getRawBits(void) const +{ + std::cout << "getRawBits member function called" << std::endl; + return this->raw_value; } -void Fixed::setRawBits(int const raw) { - std::cout << "setRawBits member function called" << std::endl; - this->raw_value = raw; + +void Fixed::setRawBits(int const raw) +{ + std::cout << "setRawBits member function called" << std::endl; + this->raw_value = raw; } |
