>>How would I go about making the second payload exactly the same as the first payload?
You can't without reallocating the entire string because the way the arrays are declared there is no room for expansion.
BTW: neither apayload nor received_payload are null-terminated strings. When you initialize character arrays like that using individual characters the array is nothing more than an array of characters, so you can't use string functions on them such as strlen() to get the number of characters.
>>I am trying this at the moment but it does not work as I guess it is just adding "0" as a character to the array and not terminating that block all together.
Yes, that only replaces the character with 0, it does not change the array size. You will have to reallocate the array if you want to make it smaller. But I don't think its worth the effort. Just put a 0 there and treat it like any other null-terminated string.
Last edited by Ancient Dragon; Jul 4th, 2008 at 10:48 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Online 21,948 posts
since Aug 2005