27 lines
578 B
C
27 lines
578 B
C
/*
|
|
* HW 12, question 5: measure a struct that points to its own type.
|
|
*
|
|
* Finish main so it prints the size of struct Node and where next is.
|
|
*
|
|
* Build and run:
|
|
* gcc -std=c99 -pedantic -Wall -Wextra -o node node.c
|
|
* ./node
|
|
*/
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
struct Node {
|
|
int value;
|
|
struct Node *next;
|
|
};
|
|
|
|
int main(void)
|
|
{
|
|
/*
|
|
* Your task: print these two numbers with these labels:
|
|
* "sizeof(struct Node) = "
|
|
* "offsetof(struct Node, next) = "
|
|
* See Canvas answer 5 for the explanation to retain.
|
|
*/
|
|
return 0;
|
|
}
|