Re: Why am I getting segmentation fault on this code
- Posted by DerekParnell (admin) Jul 14, 2017
- 1433 views
rneu said...
In a program I find that following code produces segmentation fault on compiling, even though it works well on interpreter:
aseq = tail(tail(aseq))
I am using above code to remove first 2 items of a sequence.
Why does this code produces segmentation fault after compiling?
Thanks for reporting a new bug. Every little bit helps.
Also, a faster way of removing the first 'n' items from a list is ...
aseq = aseq[n+1, $]
so in your case you could write ...
aseq = aseq[3, $]