Help needed in max sum subarray for Circular Array written by me
Link to the code:
https://ide.codingblocks.com/s/72975
It gives runtime error-SIGSEGV
“A SIGSEGV is an error(signal) caused by an invalid memory reference or a segmentation fault. You are probably trying to access an array element out of bounds or trying to use too much memory.”
PS:
If we return the address of the local variable, then the variable must be deallocated , when the function ends.
Hence the pointer in the main may be getting some garbage values. Can someone help here? 
How to do it?