The code below is broken in a subtle way. There’s no way to know that ptr is aligned on a boundary that your CPU architecture may require. And I don’t think there is any way to know until runtime. Oh, C, I love thee and loath thee!
printf("%u", *(unsigned int *)ptr);