swprnge1.cpp

swprnge1.cpp

#include ‹stl.h›

#include ‹iostream.h›

#include ‹string.h›

int main() {

 char* word1 = "World";

 char* word2 = "Hello";

 cout ‹‹ word1 ‹‹ " " ‹‹ word2 ‹‹ endl;

 swap_ranges(word1, word1 + ::strlen(word1), word2);

 cout ‹‹ word1 ‹‹ " " ‹‹ word2 ‹‹ endl;

 return 0;

}