wrote:
> Hi,
>
> My function should takes an array containing the set of all integers in
> the range of [a,b] and shuffles it into random order.
>
> For example, a = 1, b = 5, n = 3 and the random orders:
> 1.[3,4,2,1,5] 2.[2,5,1,4,3] 3.[1,4,2,3,5]
>
> Then the most similar pair of sequences is 1 and 3, since they have the
> same value in 3 position.
I do not understand the above description of the problem. What exactly is
the input (a set of integers, or just the numbers a and b)? What exactly is
the output (a vector, an array)? And how does n enter the picture? Also,
what is this notion of similarity that all of a sudden pops up.
> My problem is should I do to declare the array without knowing the
> array size? The compiler keeps getting error because I declare and
> array like int array[];
Try using std::vector. Those critters known their size.
> Can anyone help me with this?
Most certainly. But it will be easier if you show the code you have.
Best
Kai-Uwe Bux