Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions