cout<<" Name\t" <<"Cat\t" <<"Barcode\t" <<"Price\t" <<"Manufa\t" <<"Stock\t" <<"Sold\t" <<"ExDate\t " <<"Disc"<<endl; for (unsigned int i=0; i < _storage.size(); i++) { cout <<i <<":"; _storage[i]->showData(); cout<<endl; }
I am trying to display data in order. I am currently using the `t` character for this, but this will lead to misalignment if the data in one of the variables is too long.
How to display data in table form in C ++?
source share