Code:
#include <stdio.h>
struct value_entry {
char str;
int valid;
};
struct input_number_entry {
struct value_entry *value;
int value_size_word;
};
int main () {
printf("%d\n", sizeof(struct value_entry));
printf("%d\n", sizeof(struct input_number_entry));
return 0;
}
8
16
You may get slightly different answers. Physically, what that means is a "value_entry" is allocated 8 bytes, 1 for the char, 3 for padding, and 4 for the int. An "input_number_entry" is 16 bytes, 8 for the pointer (to hold 64-bit addresses), 4 for the int and 4 padding.
A value_entry* (pointer) is the address of a struct value_entry, and you can perform operations on the data at this address proper to such a datatype, eg, "value_entry->valid". However, a value_entry* is not actually the struct itself and must "point to" 8 MORE properly allocated bytes, which could happen this way:
Code:
struct value_entry one;
struct value_entry *ptr=&one;
Since that doesn't happen automatically, the answer to your question is no.