#include <iostream>
#include <string>
using namespace std;
void tolower(string s, string& t);
/* The above function converts s to lowercase 
and it returns that via the reference parameter t.
*/
int main()
{
	string s, t;
	cout << "Enter a string: " << endl;
	getline(cin,s);
	tolower(s,t);
	cout << "\n\n\t";
	cout << "The lowercase version of \"" << s 
		<< "\" is " << endl << t << endl;
	cout << "\n\n";
	system("pause");
	return 0;
}

void tolower(string s, string& t)
{
	t = s;
	int i, n = s.size();
	for (i = 0; i < n; i++)
		t[i] = tolower(s[i]);
}
