I've been trying to format the output to the console for the longest time and nothing is really happening. I've been trying to use as much of iomanip
as I can and the ofstream&
out functions.
void list::displayByName(ostream& out) const
{
node *current_node = headByName;
// I have these outside the loop so I dont write it everytime.
out << "Name\t\t" << "\tLocation" << "\tRating " << "Acre" << endl;
out << "----\t\t" << "\t--------" << "\t------ " << "----" << endl;
while ( current_node )
{
out << current_node->item.getName()// equivalent tabs dont work?
<< current_node->item.getLocation()
<< current_node->item.getAcres()
<< current_node->item.getRating()
<< endl;
current_node = current_node->nextByName;
}
// The equivalent tabs do not work because I am writing names,
// each of different length to the console. That explains why they
// are not all evenly spaced apart.
}
Is their anything That I can use to get it all properly aligned with each other? The Functions that Im calling are self-explanatory and all of different lengths, so that don't align very well with each other.
I've tried just about everything in iomanip
.