Again: 2D-Array/Table but sortable asc/desc by column for different datatypes

  • Thread starter Henri =?ISO-8859-15?Q?Schom=E4cker?=
  • Start date
H

Henri =?ISO-8859-15?Q?Schom=E4cker?=

Hi folks,

what I need is a kind of 2D-Array which should, in the end, represent a
typical html-table and which should be sortable by column.

I thought of an implementation, where an vector does not keep
the rows, as usual, but holds the single _columns_ as lists.

In this case, every column could have it's own datatype, just like
database-tables and could be sortable by the list's sort function.
Another advantage would be, that you would be able to calculate with values
of different columns of the same datatype just like with a spreadsheet
without having to convert datatypes.
For formated output a "format" function converts all fieldvalues into string
and formats them to return a, for example, html-table.

But the longer I think about it, the more difficulties come in my mind:
When sorting one column, how do I record and bind the resulting sort-order
of that column to the other columns?

Unfortunately I'm not so advanced in c++ and after reading for three days
now about matrices and 2D-arrays in c++, I still have no clue how I could
realise the sort-by-column function. Althought I think some similar kind of
matrix must be used in every simple spreadsheet application, I couldn't
find any examples for this kind of matrix/table.

Maybe I should also mention that the solution must compile on Unix/Linux as
well as on Windows.

Perhaps some of you could give me some hints, examples or links how I could
realise my table-object? Or perhaps you already have realised something
like that before?

Many thanks in advance,
every little hint is very welcomed,
yours Henri
 
H

Henri =?ISO-8859-15?Q?Schom=E4cker?=

Hi again,

many thanks for your attention if you read this.
Fortunately, I now found the right way after some more reading and trying.

Again, many thanks for your attention,
yours Henri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top