How to make a data table in c ++ | Sololearn: Learn to code for FREE!

+1

How to make a data table in c ++

Hello I am new studying programming and I would like you to help me make a data table. Thank you very much

c++

10/19/2021 6:55:56 PM

Juan Sebastian

5 Answers

New Answer

+2

I have information that I want to organize in a table using the console

+2

To print data to the console in a tabular format use either printf() using a width specifier or use cout with the width io manipulator. The data can be stored in an array if you wish. An alternative is to use a collection of objects. The class for your objects should implement a tostring() or str() method which will tabulate the data. Then to print a table simply iterate over the collection. Yet another option is to create a friend function to override the << operator.

+1

What do you mean by data table . Are u asking for database or simply make a table . If u want to make table u van use manipulators or you can do it via cout do formatting or you can use string literal like this cout<<R"( __________|___________|)";

+1

Inactive, I'm guessing he means a data table like in Pandas, a Python module used for Data Science. Pandas has 2 built-in types: Series and Data Table, that are based on Numpy arrays.

+1

Jay Matthews yes sir may be he expecting same but his question is not clear he need to give more description with examples