فهرست منبع

begin of module02

bastien 4 ماه پیش
والد
کامیت
ae5d4c4e35

BIN
Module_02/ex00/includes/.Fixed.class.hpp.swp


+ 31 - 0
Module_02/ex00/includes/Fixed.class.hpp

@@ -0,0 +1,31 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Fixed.class.hpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/16 15:46:39 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 16:14:21 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef FIXED_CLASS_H
+# define FIXED_CLASS_H
+
+class	Fixed {
+	public:
+		Fixed(void);
+		Fixed(Fixed const &src);
+		~Fixed(void);
+
+		int					getRawBits(void) const;
+		void				setRawBits(int const raw);
+
+		Fixed				&operator=(Fixed const &rhs);
+
+	private:
+		int					_value;
+		int const	_integer;
+};
+#ifndef

BIN
Module_02/ex00/srcs/.Fixed.class.cpp.swp


+ 32 - 0
Module_02/ex00/srcs/Fixed.class.cpp

@@ -0,0 +1,32 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Fixed.class.cpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/16 16:07:34 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 16:14:24 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Fixed.class.hpp"
+#include <iostream>
+
+Fixed::Fixed(void) : _value(0), _integer(8) {
+	std::cout << "Default constructor called" << std::endl;
+	return ;
+}
+
+Fixed::Fixed(Fixed const &src) {
+	*this = src;
+	std::cout << "Copy constructor called" << std::endl;
+	return ;
+}
+
+Fixed::~Fixed(void) {
+	std::cout << "Destructor called" << std::endl;
+	return ;
+}
+
+