You are viewing a single comment's thread. Return to all comments →
instead of long int *a=long int[n+1]
if we write long int a[n+1];
It shows segmentation fault.why?
because 'n' is too large to allocate for static array.
(the maximum size of static array is different by complier).
so we allocate dynamic array of size 'n+1'.