본문 바로가기

Programming/C & C++

memcpy, CopyMemory

메모리 영역 복사


1.1절. 사용법

#include <string.h>

void *memcpy(void *dest, const void *src, size_t n);
		


1.2절. 설명

memcpy 는 메모리 영역 src를 메모리 영역 dest 로 n 바이트 복사한다. 메모리 영역은 겹쳐지지 않는다. 만일 메모리 영역을 겹쳐서 사용하길 원한다면 memmove(3)를 사용한다.


1.3절. 반환값

memcpy() 함수는 포인터 dest 를 반환한다.

 

 

////////////////////////////////////////////////////////////////////////////////////////////////////////////

CopyMemory Function

Copies a block of memory from one location to another.

Syntax

void CopyMemory(
  __in  PVOID Destination,
  __in  const VOID *Source,
  __in  SIZE_T Length
);

Parameters

Destination [in]

A pointer to the starting address of the copied block's destination.

Source [in]

A pointer to the starting address of the block of memory to copy.

Length [in]

The size of the block of memory to copy, in bytes.

 

반응형