[prev] [index] [next]

Dynamic Data Example

Problem:
  • read integer data from stdin
  • first number tells how many numbers follow
  • rest of numbers are read into a vector
  • subsequent computation uses vector (e.g. sorts it)
Example input:   6 25 -1 999 42 -16 64

How to define the vector?