3 ms·
thanks. that makes sense. #include <stdio.h> void foo (int n) { struct S { int x[n]; int y; }; printf("offset: %ld\n", __builtin_offsetof(
by benmmurphy 9y ago
thanks. that makes sense.
#include <stdio.h>
void foo (int n) {
struct S { int x[n]; int y; };
printf("offset: %ld\n", __builtin_offsetof(struct S, y));
}
int main() {
foo(2);
foo(16);
}
offset: 8
offset: 64