Inspecting object bytes through a void pointer

On a little-endian machine where unsigned int is 4 bytes, a program declares unsigned int tag = 0x0A0B0C0D;. A generic dump routine receives the address of tag as a void *vp and converts it with const unsigned char *bytes = vp;. Treat byte 0 as bytes[0], the byte at the lowest address. Give byte 0, byte 1 and byte 3, each as a decimal integer.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Void Pointers Questions: