memcpy and memmove function

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
frasca
Posts: 21
Joined: 02 Feb 2011 10:32

memcpy and memmove function

#1 Post by frasca » 24 Apr 2012 10:42

The description says:

sub procedure memcpy(dim p1, p2 as ^byte, dim nn as word)

The function copies nn words from the memory area starting at the address p2 to the memory area starting at p1
But the example says:
txt = "mikroElektronika"
txt_sub = "mikr"

memcpy(@txt+4, @txt_sub, 4) ' string 'txt' will be populated with the first 4 characters of the 'txt_sub' string, beginning from the 4th character
Question: nn are words or bytes?
i hope bytes :)

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: memcpy and memmove function

#2 Post by filip » 25 Apr 2012 09:26

Hi,

nn represents number of characters(bytes), but the parameter is of word type, so the error in documentation maybe is due to this. :)

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”