2 ms·
You don't have to pass void to sizeof explicitly (which, by the way, is an operator, not a macro). The typical use case is arithmetic on void pointers, for exam
by nwellnhof 8y ago
You don't have to pass void to sizeof explicitly (which, by the way, is an operator, not a macro). The typical use case is arithmetic on void pointers, for example:
void f(void *buf) {
// Clear bytes 10-19
memset(buf + 10, 0, 10);
}
Making void pointers behave like char pointers avoids pointer casts in cases like this.