Antst
2011-09-22 06:16:34 UTC
I have written a function for extracting datasets from a file into vectors. The datasets are then used in a calculation. In the file, a user writes each dataset on a line under a heading like
My problem is that I don't know how to get the vectors out of the function! What I mean is, (1) I think I can only return one entity from a function. So I can't return i vectors. Also, (2) I can't write the vectors/datasets as function parameters and return them by reference because the number of vectors/datasets is different for each calculation.
I'm sure this is a silly question, but am I missing something here? I would be very grateful for any suggestions!
For each calculation, I DO know the number of vectors/datasets that the function will find in the file because I have that information written in the file and I extract it. Is there some way I could use this information?