Re: How to append data in an existing buffer (in C language)
- From: "gremnebulin" <peterdjones@xxxxxxxxx>
- Date: 28 Nov 2005 08:47:22 -0800
akarui.tomoda...@xxxxxxxxx wrote:
> I have a structure and one of the fields is a data buffer
> (myDestinationBuffer).
> I filled in the buffer by using memcpy() function as below:
>
> memcpy(&myDestinationBuffer, &mySourceData, myDataLength);
>
> Now I need to append 2 more bytes at the bottom of the
> "myDestinationBuffer", how can I do this ?
>
> Thanks in advance.
memcpy(&myDestinationBuffer[myDataLength], &myNewData, 2);
or
memcpy(myDestinationBuffer+myDataLength, &myNewData, 2);
.
- Follow-Ups:
- Re: How to append data in an existing buffer (in C language)
- From: akarui . tomodachi
- Re: How to append data in an existing buffer (in C language)
- References:
- How to append data in an existing buffer (in C language)
- From: akarui . tomodachi
- How to append data in an existing buffer (in C language)
- Prev by Date: Re: Newbie Questions
- Next by Date: Re: How to append data in an existing buffer (in C language)
- Previous by thread: How to append data in an existing buffer (in C language)
- Next by thread: Re: How to append data in an existing buffer (in C language)
- Index(es):
Relevant Pages
|
|