Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Written in C #include int main() { int var1 = 123; ptr = &var1; //Point ptr at var1's address printf(Ptr's address is %p ,&ptr); printf(Ptr

image text in transcribed

Written in C

#include

int main() { int var1 = 123; ptr = &var1; //Point ptr at var1's address printf("Ptr's address is %p ",&ptr); printf("Ptr is equal to %p ", ptr); printf("Ptr points to the value %d ",*ptr);

return 0; }

Pointers \& Variables: create a regular integer variable and an integer pointer variable, then perform the following tasks: a. Assign the address of the regular variable to the pointer. b. Store a value of 123 into the variable indirectly, by using the pointer with dereferencing. c. Print the address of the variable twice, first using the variable itself and then using the pointer. Print the addresses using the appropriate conversion character code. d. Print the data inside the variable twice, first using the variable itself and then using the pointer. Print the integer values using the appropriate conversion character code. e. Print the address of the pointer itself (not its stored value). Use the appropriate conversion code

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 Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

design and evaluate an effective survey instrument;

Answered: 1 week ago