memory-layout/shrink.c
2026-11-09 05:51:00 -07:00

27 lines
691 B
C

/*
* HW 12, question 4: find the smallest order for struct C.
*
* Define the two orders below, then print both sizes.
*
* Build and run:
* gcc -std=c99 -pedantic -Wall -Wextra -o shrink shrink.c
* ./shrink
*/
#include <stdio.h>
/*
* Your task: define struct C_best and struct C_worse here, then remove the
* two lines marked "placeholder" in main and print the real sizes.
*/
int main(void)
{
/*
* Print both sizes with these labels:
* "sizeof(struct C_best) = "
* "sizeof(struct C_worse) = "
*/
printf("struct C_best: not defined yet\n"); /* placeholder */
printf("struct C_worse: not defined yet\n"); /* placeholder */
return 0;
}