Question: 2. (TypeSze Problem) For any primitive type given by a user, print the memory space (i.c size) allocated to this type using sizeof (... function.

 2. (TypeSze Problem) For any primitive type given by a user,

2. (TypeSze Problem) For any primitive type given by a user, print the memory space (i.c size) allocated to this type using sizeof (... function. Example behavior of your program is (red font is user input) This is a calculator of size of a type 0) int type 1) float type n) Exit Please type a number to select a type: 0 The size of int type is 4 bytes (to be continued next page) 0) int type 1) float type n) Exit Please type a number to select a type: Note that if user type n, your program should show the main menu in 1. You get maximum of90% of this question if you include only all basic types in L7. The maximum will be 100% if you can address modifiers (long, short, signed, unsigned). As an example, the size of the type unsigned short int is 2 bytes. With modifiers, your menu may be very long. You may use a three-level menu, the first level and second allows the user to choose modifiers while the last level allows the user to choose a basic type. In the first two levels o f menu, user should have the option of choosing no modifiers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!