tabular - Displaying tables in C++ console window -
cout<<" name\t" <<"cat\t" <<"barcode\t" <<"price\t" <<"manufa\t" <<"stock\t" <<"sold\t" <<"exdate\t " <<"disc"<<endl; (unsigned int i=0; < _storage.size(); i++) { cout <<i <<":"; _storage[i]->showdata(); cout<<endl; }
i trying display data in aligned manner.i using `t` character result in misalignment if data in 1 of variable long.
how display data in table form in c++?
you can use setfill
, setw
set fill char , width of columns. problem going have limit columns right.
Comments
Post a Comment