// © Copyrights 2026 Praajna Pattada

#include <iostream>
#include <string>
#include <limits>

class SimpleObj
{
    private:
        char ID {};
        void ShowID()
        {
            std::cout << "Object ID: " << ID << '\n';
        }

    public:
        SimpleObj(char id)
        {
            ID = id;
            std::cout << "Constructor called for object with ID " << ID << "." << '\n';
            ShowID();
        }

        ~SimpleObj()
        {
            std::cout << "Destructor called for object with ID " << ID << "." << '\n';
        }
};

int main()
{
    SimpleObj Obj1 { 'A' };
    {
        SimpleObj Obj2 { 'B' };
    } // 'Obj2' goes out of scope here, so its destructor is called.
    
    std::cin.clear();
    std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
    std::cin.get();
    return 0;
}
