Filling in a table

This is a discussion on Filling in a table within the C++ Programming forums, part of the General Programming Boards category; The constructor for your table is not a y by x table. If each row can have a variable number ...

  1. #16
    Registered User
    Join Date
    May 2008
    Posts
    87
    The constructor for your table is not a y by x table. If each row can have a variable number of columns then it is not a y by x table
    Each row *cannot* have a variable number of columns. For this reason I have changed the internal representation to simply be a vector, rather than a vector of vectors. The table holds decrement rates for a demographic model. For example, it may hold termination rates from employment, looked up by age and service with employer. The startY and startX parameters specify what age/service the table begins at.

    It seems nicer or cleaner to me to be able to load in the rates into the table all at once in the constructor. What other options do you have - repeatedly calling something like fillrow() for fillcolumn() ? If a suitable iterator can be defined, how is that not preferred?

  2. #17
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Each row *cannot* have a variable number of columns. For this reason I have changed the internal representation to simply be a vector, rather than a vector of vectors.
    Ah..yes. Seems I missed that in one of your later posts.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please help me as fast as possible
    By Xbox999 in forum C Programming
    Replies: 5
    Last Post: 11-30-2009, 06:53 PM
  2. help with structs and malloc!
    By coni in forum C Programming
    Replies: 20
    Last Post: 09-14-2009, 06:38 PM
  3. Writing array, to file
    By zootreeves in forum C Programming
    Replies: 9
    Last Post: 09-08-2007, 06:06 PM
  4. extra word printing
    By kashifk in forum C++ Programming
    Replies: 2
    Last Post: 10-25-2003, 05:03 PM
  5. inputting words from a file
    By kashifk in forum C++ Programming
    Replies: 5
    Last Post: 10-24-2003, 08:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21