// Name.cpp
// takes an array of chars and turns them into a string.

#include <iostream.h>
#include <string.h>
#include "Name.h"

Name::Name(char n[])
{
	int i;
	for (i=0; n[i] != '\0' && i < NAME_LENGTH - 1; i++)
		name[i] = n[i];
	name[i] = '\0';
}

void Name::print(ostream & out)
{
	out<<name;
}

bool operator == (Name left, Name right)
{
	return ::strcmp(left.name, right.name) == 0;
}

bool operator > (Name left, Name right)
{
	return ::strcmp(left.name, right.name) > 0;
}

ostream & operator<<(ostream & out, Name & n)
{
	n.print(out);
	return out;
}
