I\'m fairly new to C++ and don\'t quite understand function parameters with pointers and references. I have an array of Cards that I want to shuffle using the Fisher-Yates
Basic arrays can't be defined with variable passed as size, as mentioned above.
And be careful there. Last element of
typename array[SIZE];
is array[SIZE-1]
, not array[SIZE]
. It's probably where you getting a segfault.
You really should at lest try to use STL containers. STL has shuffle algorithms too (: