I got a giant buffer and I need to write strings and ints to it.
I know you can write to it using memcpy / memmove. But in that case, I'd have to offset each variable.
Example :
int a = 10;
char *s = "hello world";
char buf[100];
memcpy(buf, a, 4);
memcpy(buf + 4, s, strlen(s))
As you can see I need to offset + 4 to the second memcpy for it to work.
I got tons of variables. I don't want to offset each one of them. Is it possible to do so ?
PS : the buffer is exactly the size of the sum of all variables