Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Given the following program, specify the order of the output lines when run and sorted by the address printed with the %p format specifier

image text in transcribed
image text in transcribed
1. Given the following program, specify the order of the output lines when run and sorted by the address printed with the %p format specifier on a Sun SPARC Unix system. For example, which line will print the lowest memory address, then the next higher memory address, etc. up to the highest memory address? [17pts #include #include void foot int float Function Prototype smallest value (lowest memory address) int a = 1; int b 1234; int * c &b; int main( int argc, char argv int d 404; struct baz f int a; float b;e: foo f argc, e.b ) /1(void) printf "1: a plIn", sa ) /* /* 2 (void) printf( "2: b tpln", b 3 */ (void) printf( "3: argv--> %p ", sargv ); 4 */ (void) printf( "4: c--> %p ", &C ); 5(void) printf( "5: d pln", d 6 (void) printf 6: foo pln", foo 7 /* /* /* /* 8 9 10 */ */ */ */ (void) (void) (void) (void) printf( "7: e.b --> %pin", &e.b ); printf( "8: arge--> %p ", &argc ); printf( "9: e.a --> %p ", &e.a ); printf( "10: *c --> %p ", c ); return 0 void foot int f, float g) int h[3] static struct foo (int a: int b;) 4 largest value if c NULL (highest memory addresses) /* /* /* 11 12 13 */ */ */ (void) (void) (void) printf( printf( print f ( "11: "12: "13: malloc --> %p ", malloc (4) .a --> %pin", &i.a ); h[2] --> %p ", &h121 ); )

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions