Home > Computers & Tech > Detail
search_icon
Question

a struct definition for cartesianpoint has subitems int x and int y. how many int locations in memory does the struct definition allocate?

Answer

8 bytes or 64 bits

  • Q:What is the size of an int in memory? A:The size of an int in memory depends on the system architecture. In most systems, an int is typically 4 bytes or 32 bits.
  • Q:How many ints does the struct definition for cartesianpoint contain? A:The struct definition for cartesianpoint contains 2 ints: x and y.
  • Q:How many int locations in memory does the struct definition allocate? A:The struct definition for cartesianpoint allocates 8 bytes or 64 bits of memory in most systems since there are 2 ints, each 4 bytes or 32 bits in size.