FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question regarding memcpy

 
Post new topic   Reply to topic     Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
wyrmchild



Joined: 27 May 2006
Posts: 12
Location: Europe

PostPosted: Wed Jun 28, 2006 11:35 am    Post subject: Question regarding memcpy Reply with quote

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
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Thu Jun 29, 2006 9:00 pm    Post subject: Reply with quote

Try

Code:
uint value = *cast(uint*)string[0 .. 4].ptr;
Back to top
View user's profile Send private message
wyrmchild



Joined: 27 May 2006
Posts: 12
Location: Europe

PostPosted: Fri Jun 30, 2006 12:01 am    Post subject: Reply with quote

Works perfectly, thanks :)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group