CJCoding With Joseph
15per day
← Back to Question List

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

Topics:
C++ Quiz #21

Unfreed Heap Memory

easyDynamic Memory

This code compiles and runs, but it has a problem. What is the issue?

📄 Code

1#include <iostream>
2using namespace std;
3 
4void createValue() {
5 int* p = new int(42);
6 cout << *p << endl;
7}
8 
9int main() {
10 createValue();
11 return 0;
12}