You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've stumbled upon a strange problem using c/c++ extension for VSCode. Below I have the following code:
Car *car = new Car();
cout << "Car Created \n";
delete car;
cout << "Car Deleted \n";
return 0;
The problem is, that it doesn't print out anything, neither the first cout, neither the second.
It turns out when I remove "delete car;" the code prints out everything as it should. So the following code works:
Car *car = new Car();
cout << "Car Created \n";
cout << "Car Deleted \n";
return 0;
But now I'm not deallocating the allocated memory using "new".
Am I doing something wrong or is this a bug? It works just fine with CodeBlocks latest version. Should I report this as a bug?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I've stumbled upon a strange problem using c/c++ extension for VSCode. Below I have the following code:
The problem is, that it doesn't print out anything, neither the first cout, neither the second.
It turns out when I remove "delete car;" the code prints out everything as it should. So the following code works:
But now I'm not deallocating the allocated memory using "new".
Am I doing something wrong or is this a bug? It works just fine with CodeBlocks latest version. Should I report this as a bug?
Beta Was this translation helpful? Give feedback.
All reactions