We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Why am I getting this error when I have not even touched main() ?
Here's my function code
int i,j,arr[queries_count];
*result_count=queries_count;
k = k % a_count;
for(i=1;i<=queries_count;i++)
{
j=queries[i]-k;
if(j<0)
arr[i]=a[a_count+j];
else
arr[i]=a[j];
}
return arr;
}
Segmentation Fault
Error (stderr)
GDB trace:
Reading symbols from solution...done.
[New LWP 2592]
Core was generated by `solution'.
Program terminated with signal SIGSEGV, Segmentation fault.
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
Why am I getting this error when I have not even touched main() ?
Here's my function code
}
Segmentation Fault Error (stderr)
GDB trace: Reading symbols from solution...done. [New LWP 2592] Core was generated by `solution'. Program terminated with signal SIGSEGV, Segmentation fault.
0 fprintf (__fmt=0x400cc4 "%d", __stream=0x155d010)
97 return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
0 fprintf (__fmt=0x400cc4 "%d", __stream=0x155d010)
1 main () at solution.c:97