...
Code Block | ||
---|---|---|
| ||
struct big { unsigned long long memberull_1; /* typically 8 bytes */ unsigned long long memberull_2; /* typically 8 bytes */ unsigned long long memberull_3; /* typically 8 bytes */ int membersi_4; /* typically 4 bytes */ int membersi_5; /* typically 4 bytes */ }; /* ... */ size_t skip_member = sizeof(unsigned long long); struct big *s = malloc(sizeof(struct big)); if (!s) { /* Handle malloc() error */ } memset(s + skip_member, 0, sizeof(struct big) - skip_member); /* ... */ free(s); |
...