Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following C++ program: #include using namespace std; int main() { struct foo_t { int x[100]; int var1; int y[10]; } foo; int var2;

Consider the following C++ program: #include using namespace std; int main() { struct foo_t { int x[100]; int var1; int y[10]; } foo; int var2; long i; int *p, *q; short int *s; long int *l; struct foo_t bar[50]; for (i=0; i

Part 0, Need to use output for the rest of the parts. But no need for answer of Part 0.

image text in transcribed

image text in transcribed

image text in transcribed

Part 0 Run the above program (commenting out the lines with blanks) on the computer/compiler you normally use. You may need to modify the header slightly for your system. If the program does not work on your computer, you can either modify it to work, use a compiler flag to generate working code, or run it on the G-lab computers where it works using g++. Note that accounts for you have been created on the CS department Linux Lab (1000G), and you can access it the same you did in CSCI 127/135 What output do you get? Make sure to mention which computer and compiler you are using. You will need to understand your output before you proceed to the rest of this homework. Part 1 Based on the program's output, determine how many bits your system uses to store short, regular, and long integers. The answer may differ depending on your compiler and processor. Part 2 You wish to determine how many bits your system uses to store pointers. Modify the program to determine this (label your modification "MOD" in comments), and state your conclusions

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago