The best and simplest compiler to program in Windows is Dev-C++, i recommend you to look for it in Google, i compiled your program witout any errors, only change
void main()
by
int main()
and i think that when you use swap you meant Swap (it compiled because actually there exists a STL function ...