• + 0 comments

    The memory allocated on the line:

    long int *a=new long intN+1;

    Memory allocated to long int a in never deleted in the main(). It will cause memory leak. Try executing the same program with valgrind, you will find the memory leak.