24
An efficient way would be to cast the pointer to a pointer of the needed size in bytes (e.g. uint32_t for 4 bytes) and fill with integers. It's a little ugly though.
char buf[256] = { 0, };
uint32_t * p = (uint32_t *) buf, i;
for (i = 0; i < sizeof(buf) / sizeof(* p); i++) {
p[i] = 0x11223344;
}
Not tested!