Well on a regular basis i get obstructed with this error , the monitored command dumped core.
Which is pretty much alien language to me, hence i cannot not possibly understand what the compiler is saying.
I looked up the internet , for what could be the reason and found out that i could be accessing index which has not been allocated memory, therefore i set on to make a simplest code possible and encounter the same error.
#include<stdio.h>
int main()
{
int n;
int a[100000];
scanf("%d",&n);
int j=0;
for(int i=2;i<=n;i+2)
{
if (i%2==0)
{
a[j]=i;
j+=1;
}
}
return 0;
}
But i don't understand how i could be accessing non allocated memory.
Also what could be the other reasons for the same error to occur such frequently.