diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-04-13 13:07:19 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-04-13 13:07:19 +0200 |
| commit | 3d48ed0312f9c0ae691560d7cd688f46917e3fd4 (patch) | |
| tree | a9ad6b750bfef47e91f85be187ed5a27edd2bd9c /cpp02/ex01/main.cpp | |
| parent | 0f3240844dbd5a874e1565a988ef355ededab6a5 (diff) | |
| download | piscine_cpp-3d48ed0312f9c0ae691560d7cd688f46917e3fd4.tar.gz piscine_cpp-3d48ed0312f9c0ae691560d7cd688f46917e3fd4.tar.bz2 piscine_cpp-3d48ed0312f9c0ae691560d7cd688f46917e3fd4.zip | |
cpp02 base
Diffstat (limited to 'cpp02/ex01/main.cpp')
| -rw-r--r-- | cpp02/ex01/main.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cpp02/ex01/main.cpp b/cpp02/ex01/main.cpp new file mode 100644 index 0000000..44ffe34 --- /dev/null +++ b/cpp02/ex01/main.cpp @@ -0,0 +1,35 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/13 11:51:15 by charles #+# #+# */ +/* Updated: 2020/04/13 12:08:07 by charles ### ########.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; +} |
