Repository navigation
Fb Memmove
Home › Memory Functions › Fb_Memmove
Copies a number of bytes between two memory areas, even when they overlap.
Declare Function fb_memmove cdecl ( ByRef dst As Any, ByRef src As Any, ByVal bytes As UInteger ) As Any Ptrdstsrcbytes
fb_memmove copies a given number of bytes from the memory location src to the memory location dst. Each starting address is taken from a reference to a variable or array element.
Copying takes place as if an intermediate buffer were used, allowing the destination and source areas to overlap in any way (safer approach, and for any platform). Using Fb_Memcopy is sufficient (and may induce greater speed) when the memory areas do not overlap.
To avoid overflows, the valid memory areas pointed to by both src and dst must be at least equal in size to the number of bytes to be copied.
The underlying type of the objects pointed to by both the source and destination pointers are irrelevant for this function.
The function does not check for any terminating null character in the source area. It always copies exactly the given number of bytes.
The result is a binary copy of the data.
Note: In order to copy from/to memory referenced by a Pointer, it must be dereferenced first (or else specify in argument term the ByVal keyword in front of the pointer name). Otherwise, fb_memmove will try to copy the bytes from/to the pointer variable's memory location.
The starting address of destination memory is returned.
[result =] fb_memmove( dst, src, bytes )
- The behavior and usage is new to FreeBASIC.
Dim As ZString * 33 z = "memmove can be very useful......"
Print z
fb_memmove(z[20], z[15], 11)
Print z
SleepOutput:
memmove can be very useful......
memmove can be very very useful.
Category: Memory Functions
Kind: function
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing