C++ Programming Question:

Download Job Interview Questions and Answers PDF

Write a function that swaps the values of two integers, using int* as the argument type.

C++ Programming Interview Question
C++ Programming Interview Question

Answer:

void swap(int* a, int*b) {
int t;
t = *a;
*a = *b;
*b = t;
}

Download C++ Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What is public, protected, private in C++?Tell how to check whether a linked list is circular.