CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Delete on Stack Variable

C++ quiz · Question 22
easyDynamic Memory

This code has a bug that causes undefined behavior. What is the issue?

Code

1#include <iostream>
2using namespace std;
3 
4int main() {
5 int x = 10;
6 int* p = &x;
7 cout << *p << endl;
8 delete p;
9 return 0;
10}