Re: Doubt in memcpy() and memset()
- From: Chris Dollin <chris.dollin@xxxxxx>
- Date: Wed, 06 Dec 2006 11:59:52 +0000
Shhnwz.a wrote:
I want to know some of the situations , when to use memcpy() and when
to memset();
Can't you tell from their descriptions?
memcpy( void *s1, const void *s2, size_t n );
... copies n characters from the object pointed to by s2
into the object pointed to by s1. If copying takes place
between objects that overlap, the behaviour is undefined.
memset( void *s, int c, size_t n );
... copies the value of c (converted to an unsigned char)
into each of the first n characters of the object pointed
to by s.
Use whichever one fits your situation.
--
Chris "Perikles triumphant" Dollin
"No-one here is exactly what he appears." G'kar, /Babylon 5/
.
- Follow-Ups:
- Re: Doubt in memcpy() and memset()
- From: Dead Loop
- Re: Doubt in memcpy() and memset()
- References:
- Doubt in memcpy() and memset()
- From: Shhnwz.a
- Doubt in memcpy() and memset()
- Prev by Date: Re: Doubt in memcpy() and memset()
- Next by Date: Re: alignment question about pointer conversion
- Previous by thread: Re: Doubt in memcpy() and memset()
- Next by thread: Re: Doubt in memcpy() and memset()
- Index(es):
Relevant Pages
|
|