Answered step by step
Verified Expert Solution
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.
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 conclusionsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started