SIGSEGV error is caused when you try to access the memory address which is not assigned in the system or you are not allowed to access it.
Here, when you give n = 1000 , you are trying to access &dp[999]+sizeof(data type) which may be the next address in the contiguous block. So it will return some garbage value because memory is there and is accessible.
But if you try to give greater values of n you may get SIGSEGV error.