1 2 3 4 5 6 7 8 9 10
void init(char v, char *buf, int n) { char *b = buf; while (b < buf+n) { *b++ = val; } } ... char *buf = malloc(2); init('A', buf, sizeof(buf));