Hi every one :)
Well I wrote this code for deleting the pointers, and it compiles and runs. But at the end of the run it comes up with an Debug Assertion failed.
WHY???
#include <iostream>
using namespace std;
int main()
{
bool boolVar = true;
int intVar = 50;
float floatVar = 3.14f;
bool* boolPtr = &boolVar;
int* intPtr = &intVar;
float* floatPtr = &floatVar;
cout << "boolVar = " << boolVar << endl;
cout << "intVar = " << intVar << endl;
cout << "floatVar = " << floatVar << endl;
cout << endl;
cout << "boolPtr = Address of boolVar = " << boolPtr << endl;
cout << "intPtr = Address of intVar = " << intPtr << endl;
cout << "floatPtr = Address of floatVar = " << floatPtr << endl;
delete boolPtr;
boolPtr = 0;
delete intPtr;
intPtr = 0;
delete floatPtr;
floatPtr = 0;
}