View previous topic :: View next topic |
Author |
Message |
wyrmchild
Joined: 27 May 2006 Posts: 12 Location: Europe
|
Posted: Wed Jun 28, 2006 11:35 am Post subject: Question regarding memcpy |
|
|
Is there a pure D way to do std.c.string.memcpy()?
I'm currently doing something like this (pseudo-code)
Code: | memcpy(uint, char[0..4], 4); |
|
|
Back to top |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Thu Jun 29, 2006 9:00 pm Post subject: |
|
|
Try
Code: | uint value = *cast(uint*)string[0 .. 4].ptr; |
|
|
Back to top |
|
|
wyrmchild
Joined: 27 May 2006 Posts: 12 Location: Europe
|
Posted: Fri Jun 30, 2006 12:01 am Post subject: |
|
|
Works perfectly, thanks :) |
|
Back to top |
|
|
|