Back to Multiple Choice Quiz
Delete on Stack Variable
C++ quiz · Question 22This code has a bug that causes undefined behavior. What is the issue?
Code
1#include <iostream>2using namespace std;34int main() {5 int x = 10;6 int* p = &x;7 cout << *p << endl;8 delete p;9 return 0;10}