我有一个接收指针的函数,我想修改指针所在的位置值。
// How a 'State' looks like
State s = std::array<std::array<Player,7>,6>;
// I'm receiving a pointer to the state
void Set(State *s, int col, int row, Player player)
{
// Modify the state (s)
s[row][col] = player; // not working
*s[row][col] = player; // not working
s->[row][col] = player; // compile error
}
如何使用指针正确修改值(播放器)?