Answer to Question #181991 in C++ for Weam

Question #181991

How much memory will be allocated for anobject of class given below?


class Time{

int Hour;

int Min;

int Sec;

char ampm[2];

};


Select one:

a. 20

b. 14

C. 16

d. 18


1
Expert's answer
2021-04-15T16:16:51-0400

For integer members total memory occupied = 2 x 3 = 6 bytes

For character array total memory occupied = 4 x 2 = 8 bytes

Total memory occupied = 6 + 8 = 14 bytes

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS