Is swap() a built in function?

Is swap() a built in function? Or does it need some specific header file?

hi @Ayush280301, swap is a built in function does’nt need any specific header, but in previous version of c++ it was declared under <algorithm.h> header file , so to be in safe zone u can declare algorithm header file

In case of any doubt feel free to ask :slight_smile:
If you got the answer them mark your doubt as resolved

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.