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