C++ Programming Question:
Download Questions PDF

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

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.