Question: Write a program (in Q0.c) to do the following: In main(), declare an integer x. Print the address of x (using the address-of operator). Pass
Write a program (in Q0.c) to do the following:
In main(), declare an integer x. Print the address of x (using the address-of operator). Pass x as an argument to a function void fooA(int* iptr). (Hint: can you pass x itself directly?)
In fooA(int* iptr), print the value of the integer pointed to by iptr, the address pointed to by iptr, and the address of iptr itself.
In the main function, following the call to fooA(...) , print the value of x.
Implement function int fooB(int* a, int *b, int c) which should perform the following computations:
Assign a + b to c.
Set the value pointed to by a to the value pointed to by b.
Set the value pointed to by b to double its original value.
Return the value of c.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
