Open JuaniRaggio opened 5 hours ago
Hola, como va? No me esta dando el ultimo assert, no entiendo porque.
#define offsetof(dataStructure, field) (long)(&(((dataStructure *)0)->field)) #include <assert.h> #include <stdio.h> typedef struct { int v1; char v2; char v3; double d1; char arr1[5]; } prueba; int main(void){ assert(offsetof(prueba, v1) == 0); assert(offsetof(prueba, v2) == 4); assert(offsetof(prueba, v3) == 5); assert(offsetof(prueba, d1) == 8); assert(offsetof(prueba, arr1[0]) == 12); printf("OK!"); return 0; }
tu double ocupa 8, asi q deberia dar 16 el ultimo assert no 12
si fuera float daria 12
aa buenisimo, muchas gracias
Hola, como va? No me esta dando el ultimo assert, no entiendo porque.