Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.2 KB

File metadata and controls

47 lines (33 loc) · 1.2 KB

C++ Module 06

This module explores C++ type conversions, casting, reinterpretation, and dynamic type identification using virtual functions.

🛠️ Usage

For each exercise, navigate to its folder, compile, and run:

📂 ex00

cd ex00
make
./convert

📂 ex01

cd ex01
make
./serializer

📂 ex02

cd ex02
make
./downcast

📝 Exercise Descriptions

ex00 — Conversion of scalar types: Implement a ScalarConverter class to detect and convert a string literal into char, int, float, and double. Handle pseudo-literals like nan, +inf, -inf.

ex01 — Serialization: Implement a Serializer class with static methods serialize() and deserialize() to convert a pointer to an integer and back. Test with a Data structure.

ex02 — Identify real type: Create a Base class with derived A, B, C. Implement functions to randomly generate instances and identify their type at runtime using dynamic casting (no typeinfo).

💼 Connect

If you have any questions or suggestions, feel free to connect: 🔗 LinkedIn: Valentina Nguyen 🙋‍♀️

🖥️ System Compatibility

This project was developed and tested on Linux (Ubuntu).