Which of the following is correct way of copying the values of pair p1 into other pair p2?

a) pair <type,type> p2 = p1;
b) pair <type,type> p2(p1);
c) Both pair <type,type> p2 = p1; and pair <type,type> p2(p1);
d) Pair <int,int> p2.copy(p1);

1 thought on “Which of the following is correct way of copying the values of pair p1 into other pair p2?”

Leave a Comment