/************************************************
 ** Step through this program with the debugger,
 ** and you'll see how "rep('$',30)" actually
 ** results in calls to both versions of rep.
 ************************************************/
#include <iostream>
using namespace std;

//-- PROTOTYPES --------------------------------//
void rep(char,int,ostream&);
void rep(char,int );

//-- MAIN --------------------------------------//
int main()
{
  rep('$',30);
  cout << endl;
  return 0;
}

//-- DEFINITIONS -------------------------------//

void rep(char c, int k, ostream& OUT)
{
  for(int i = 0; i < k; i++)
    OUT << c;
}

void rep(char c, int k)
{
  rep(c,k,cout);
}