I want to cout a table like output using c++. It should look like this
Passes in Stock : Student Adult
-------------------------------
Spadina 100 200
Bathurst 200 300
Keele 100 100
Bay 200 200
yet mine always looks like
Passes in Stock : Student Adult
-------------------------------
Spadina 100 200
Bathurst 200 300
Keele 100 100
Bay 200 200
my code for the output
std::cout << "Passes in Stock : Student Adult" << std::endl;
std::cout << "-------------------------------";
for (int i = 0; i < numStations; i++) {
std::cout << std::left << station[i].name;
std::cout << std::right << std::setw(18) << station[i].student << std::setw(6) << station[i].adult << std::endl;
}
how can I change it so it looks like the output at the top?