Question
C++

Question 15 3.95 pts struct Person int age; char gender; double weight: string name; Person p[35, M, 175.5, Steve); Which
Which of the options below correctly represents how the structure object p is stored in memory? B-) RAM (Memory) Address Valu
RAM (Memory) Address Value Address o Address 1 Address 2 Address 3 Address 4 ...(gap in memory) Address 24-31 in ... (gap in
RAM (Memory) Address Value Address 0-3 Address 4 Address 5-12 175.5 Address 13 Address 14 Address 15 Address 16 Address 17 RA
RAM (Memory) Address Value Address 0-3 35 ... gap in memory) Address 20 M ... (gap in memory) A Address 20 ... sap in memory)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ans:Option A is correct

Exaplanation

int age

here int takes 4 bytes of memory than 0-3 allocated for it which is 35

char gender

where char takes 1 byte memory so than 4th address allocated to gender which is 'M'

double weight

where double takes 8 bytes of memory so than 5-12 which is 8 bytes allocated to double weight than 175.5 is stored in that address

string steve

where steve have 5 character strings so 5 bytes required to store the string data so

address of 13 stored first index of string 's'

address of 14 stored second index of the string 't'

address of 15 stored third index of the string 'e'

address of 16 stored forth index of the string 'v'

address of 17 stored fifth index of the string 'e'

so than it completed

so answer is OPTION A is correct

#if you have any doubt or more information needed comment below..i will respond as possible as soon..thanks..

Add a comment
Know the answer?
Add Answer to:
C++ Question 15 3.95 pts struct Person int age; char gender; double weight: string name; Person...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT