Listing 3

(a)
// to_upper.hpp
#include <iostream>
#include <cctype>

namespace to_upper
{
  using namespace std;
  int main() {
    char c;
    while (cin.get(c)) { cout.put(toupper(c)); }
    return 0;
  }
}
     


(b)
// to_upper.cpp
#include "to_upper.hpp"

int main() {
  return to_upper::main();
}