Why i am getting this error ? What is meant by segmentation fault ? Please explain…
Segmentation Fault
hello @mb129162
A segmentation fault is a common condition that causes programs to crash; they are often associated with a file named core . segmentation faults are caused by a program trying to read or write an illegal memory location .
pls share ur code so that i can check whats going wrong in it
it is giving segmentation fault because u are using too much memory.
always declare array like
int n;
cin>>n;
int arr[n];
this will use only require amount of memory.
check ur updated code here