Answered step by step
Verified Expert Solution
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
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 codeStep 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