How to Force a Destructor Call in C++ Net

104 7
    • 1). Open the Visual Studio IDE and make a new C++ project. A blank source code file will appear on the main workspace window.

    • 2). Create a new String object by typing the following line of code:

      String myString = new String();

    • 3). Call the destructor by typing the following line of code:

      myString.String::~String();

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.