I am looking for some opinions on programming style.
The following two example programs both run as intended and are similar.
The Row class is composed of an array of samples.
The Row class will be in a library.
The size of the sample array is a constant value determined by the main program.
Which example is the better programming style?
1) sample[] array is created in the main program and passed to the Row constructor:
If the number of samples is a constant known at compile time, 2. is simple and direct.
1. is more flexible; the number of samples can be determined at runtime.
> Is there a third way that is better?
If the number of samples is a constant known at compile time (better version of 2.)