memcat()
-
Like memcpy(), is there any method for appending the array i,e memcat()....how could i use it???
-
Like memcpy(), is there any method for appending the array i,e memcat()....how could i use it???
There isn't a
memcat()
function that corresponds to thestrcat()
function. If you think about it, a 'memcat
' function doesn't make sense.strcat()
does string concatenation. A string is a sequence of bytes, terminated by a zero byte. Themem*
functions operate onmem
ory, which is a sequence of bytes, but not terminated. Instead, themem*()
functions require that you specify a size for the region of memory you are copying. Given that explanation,memcpy()
will do 'memory concatenation' for you:memcpy(destination + destination_length,source,source_length);
destination_length += source_length;In this case, you are 'concatenating' a
source
buffer that issource_length
bytes long to the end of adestination
buffer that is, prior to the concatenation,destination_length
bytes long.
Software Zen:
delete this;