By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Dec 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Dec 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.