C++ Array Shuffle

后端 未结 10 2040
温柔的废话
温柔的废话 2021-01-07 14:06

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

10条回答
  •  忘掉有多难
    2021-01-07 14:40

    You declared deck as an array of pointers but you didn't allocate any space for it. If you de-reference it without allocating space you will get a seg-fault.

提交回复
热议问题