Swap function??Works perfectly if your main returns int (and if you compile it with g++).
why can't I output two files?You don't have an include for exit (http://cplusplus.com/reference/clibrary/cstdlib/exit/), you dec...