+
Skip to content
/ cpp06 Public

The project covers C++ casts, including static_cast, dynamic_cast, const_cast, and reinterpret_cast

Notifications You must be signed in to change notification settings

ngtina99/cpp06

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).

About

The project covers C++ casts, including static_cast, dynamic_cast, const_cast, and reinterpret_cast

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载