You tried to print a pointer to uint32_t as int. You have to do two things:
- Search for a pointer so that you can type uint32_t, not a pointer.
- use the correct printtf format specifier.
The correct way to format uint32_t is to use the PRIu32 macro, which expands to a format character as a string.
That is, you do
printf("%"PRIu32"\n", *var.value);
You are probably on a common platform where the unsigned int matches uint32_t, in which case you can simply do:
printf("%u\n", *var.value);
(note:% u instead of your code that used% d,% u for an unsigned int, and% d for a signed int)
source share