C++ Programming Question: Download Questions PDF
Write a function that swaps the values of two integers, using int* as the argument type.
![C++ Programming Interview Answer C++ Programming Interview Question](https://globalguideline.com/public/images/interview/24.png)
Answer:
void swap(int* a, int*b) {
int t;
t = *a;
*a = *b;
*b = t;
}
int t;
t = *a;
*a = *b;
*b = t;
}
Download C++ Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
What is public, protected, private in C++? | Tell how to check whether a linked list is circular. |