Is swap a predefined function in C++ and if yes the how does it work?
Is swap function predefined?
@Prakhar_Nagpal yes in c++ its predefined , in array use it like swap(a[idx1],a[idx2]) and it will swap the two values in array . and for simply two variables a,b swap(a,b)
hope its clear if yes dont forget to mark it as resolved 