Skip to main content

Mojo function

memcpy

memcpy[T: AnyType](*, dest: UnsafePointer[T, dest.origin], src: UnsafePointer[T, src.origin], count: Int)

Copy count * size_of[T]() bytes from src to dest.

The dest and src memory must not overlap. For potentially overlapping memory regions, use memmove.

Parameters:

  • ​T (AnyType): The element type.

Args:

  • ​dest (UnsafePointer): The destination pointer.
  • ​src (UnsafePointer): The source pointer.
  • ​count (Int): The number of elements to copy.

Was this page helpful?