 
                 
                InterviewSolution
| 1. | Explain with example by passing the pointers. | 
| Answer» #include <iostream> // function definition to swap the values, void swap(int *x, int *y) The output of the above program is: In the above program, swap() function is declared with two arguments of type integer pointers. During the function call memory address of variable, ‘a’ and variable ‘b’ is passed as actual arguments, and formal arguments are pointer ‘x’ and pointer Y takes the address of ‘a’ and ‘b’ variables respectively. In the body of the swap function, the pointer operator is used to access the value at the location. Here the memory location of ‘a’ and ‘b’ are accessed by the pointers V and Y and produces the output as shown above. | |