How to Force a Destructor Call in C++ Net
- 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();