diff options
Diffstat (limited to 'cpp02/ex01/main_DO_NOT_TURN_ME_IN.cpp')
| -rw-r--r-- | cpp02/ex01/main_DO_NOT_TURN_ME_IN.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/cpp02/ex01/main_DO_NOT_TURN_ME_IN.cpp b/cpp02/ex01/main_DO_NOT_TURN_ME_IN.cpp new file mode 100644 index 0000000..f2eb5e0 --- /dev/null +++ b/cpp02/ex01/main_DO_NOT_TURN_ME_IN.cpp @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main_DO_NOT_TURN_ME_IN.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/13 11:51:15 by charles #+# #+# */ +/* Updated: 2020/11/10 10:00:32 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include <iostream> +#include "Fixed.hpp" + +int main(void) +{ + Fixed a; + Fixed const b(10); + Fixed const c(42.42f); + Fixed const d(b); + + a = Fixed(1234.4321f); + + std::cout << "a is " << a << std::endl; + std::cout << "b is " << b << std::endl; + std::cout << "c is " << c << std::endl; + std::cout << "d is " << d << std::endl; + + std::cout << "a is " << a.toInt() << " as integer" << std::endl; + std::cout << "b is " << b.toInt() << " as integer" << std::endl; + std::cout << "c is " << c.toInt() << " as integer" << std::endl; + std::cout << "d is " << d.toInt() << " as integer" << std::endl; + + return 0; +} |
