Section 16.8. Memory Block Handling


16.8. Memory Block Handling

The functions listed in Table 16-21 initialize, copy, search, and compare blocks of memory. The functions declared in the header string.h access a memory block byte by byte, while those declared in wchar.h read and write units of the type wchar_t. Accordingly, the size parameter of each function indicates the size of a memory block as a number of bytes, or as a number of wide characters.

Table 16-21. Functions to manipulate blocks of memory

Purpose

Functions in string.h

Functions in wchar.h

Copy a memory block, where source and destination do not overlap

memcpy( )

wmemcpy( )

Copy a memory block, where source and destination may overlap

memmove( )

wmemmove( )

Compare two memory blocks

memcmp( )

wmemcmp( )

Find the first occurrence of a given character

memchr( )

wmemchr( )

Fill the memory block with a given character value

memset( )

wmemset( )




C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net