use of C memmove

2011-04-07 Thread spir
Hello, I'm trying to use C's memmove as a tool to delete or insert a slice from/into an array. But I cannot manage to do it: systematic segmentation fault. What is wrong below? import std.c.string : memmove; // void *memmove(void *dest, const void *src, size_t n); void moveEnd (E) (E[]

Re: use of C memmove

2011-04-07 Thread Steven Schveighoffer
On Thu, 07 Apr 2011 13:09:05 -0400, spir denis.s...@gmail.com wrote: Hello, I'm trying to use C's memmove as a tool to delete or insert a slice from/into an array. But I cannot manage to do it: systematic segmentation fault. What is wrong below? import std.c.string : memmove; // void

Re: use of C memmove

2011-04-07 Thread Kagamin
spir Wrote: // If move down, compress array. if (offset 0) elements.length += offset; ow, addAssign works on length?

Re: use of C memmove

2011-04-07 Thread Steven Schveighoffer
On Thu, 07 Apr 2011 14:44:28 -0400, Kagamin s...@here.lot wrote: spir Wrote: // If move down, compress array. if (offset 0) elements.length += offset; ow, addAssign works on length? Since 12/09 :) http://www.digitalmars.com/d/2.0/changelog.html#new2_037 -Steve

Re: use of C memmove

2011-04-07 Thread spir
On 04/07/2011 08:12 PM, Steven Schveighoffer wrote: On Thu, 07 Apr 2011 13:09:05 -0400, spir denis.s...@gmail.com wrote: Hello, I'm trying to use C's memmove as a tool to delete or insert a slice from/into an array. But I cannot manage to do it: systematic segmentation fault. What is wrong