summaryrefslogtreecommitdiff
path: root/ex01/main.cpp
diff options
context:
space:
mode:
authorDominik Kaiser2025-02-13 16:41:08 +0100
committerDominik Kaiser2025-02-13 16:41:08 +0100
commit1fff37e7b9b63e5e62e9d9d0eb4535636f7f2fe8 (patch)
tree7ae7a938fbe2a486d7512730f48648ab26f52515 /ex01/main.cpp
parentb013c2457c45d369c9fc9a854caacdffd414ca25 (diff)
downloadcpp02-1fff37e7b9b63e5e62e9d9d0eb4535636f7f2fe8.tar.gz
cpp02-1fff37e7b9b63e5e62e9d9d0eb4535636f7f2fe8.zip
Add ex01HEADmain
Diffstat (limited to 'ex01/main.cpp')
-rw-r--r--ex01/main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/ex01/main.cpp b/ex01/main.cpp
new file mode 100644
index 0000000..5c9fd7b
--- /dev/null
+++ b/ex01/main.cpp
@@ -0,0 +1,32 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/13 14:53:26 by dkaiser #+# #+# */
+/* Updated: 2025/02/13 14:53:52 by dkaiser ### ########.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;
+}