Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Programming // use stdio.h, stdlib.h, string.h and math.h only. Extend the following program to show the value and the location at which each variable

C Programming // use stdio.h, stdlib.h, string.h and math.h only.

Extend the following program to show the value and the location at which each variable is stored.

#include int main (void) { int a = 1, b = 2; int* ptr = &b; /* your code goes here */ return 0; }

Find out the correct format specifier to print a pointer.

Observe the values and locations, and answer the following questions.

1. What are the values of - a, b, ptr ?

2. What are the locations of - a, b, ptr (yes, the location of the pointer ptr) ?

3. Any of the locations are the same?

4. Any of the values are the same?

5. Explain the relationship between the value of ptr and the location of b.

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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions