smart pointer c 2b 2b

Solutions on MaxInterview for smart pointer c 2b 2b by the best coders in the world

showing results for - "smart pointer c 2b 2b"
Alia
08 Aug 2018
1void my_func()
2{
3    int* valuePtr = new int(15);
4    int x = 45;
5    // ...
6    if (x == 45)
7        return;   // here we have a memory leak, valuePtr is not deleted
8    // ...
9    delete valuePtr;
10}
11 
12int main()
13{
14}