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.
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. |