Buffer Manipulation

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Buffer Manipulation.

Use these routines to work with areas of memory on a byte-by-byte basis.

Buffer-Manipulation Routines

RoutineUse.NET Framework equivalent
_memccpyCopy characters from one buffer to another until given character or given number of characters has been copiedSystem::Buffer::BlockCopy, System::String::Copy
memchr, wmemchrReturn pointer to first occurrence, within specified number of characters, of given character in bufferNot applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
memcmp, wmemcmpCompare specified number of characters from two buffersSystem::String::Compare, System::String::Equals
memcpy, wmemcpy, memcpy_s, wmemcpy_sCopy specified number of characters from one buffer to anotherSystem::Buffer::BlockCopy, System::String::Copy
_memicmp, _memicmp_lCompare specified number of characters from two buffers without regard to caseSystem::String::Compare, System::String::Equals
memmove, wmemmove,memmove_s, wmemmove_sCopy specified number of characters from one buffer to anotherSystem::Buffer::BlockCopy
memset, wmemsetUse given character to initialize specified number of bytes in the bufferSystem::Buffer::SetByte
_swabSwap bytes of data and store them at specified locationNot applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

When the source and target areas overlap, only memmove is guaranteed to copy the full source properly.

Run-Time Routines by Category

Show: