[computer-go] C++ parameter passing

Paul Pogonyshev pogonyshev at gmx.net
Wed Aug 9 14:59:05 PDT 2006


Weston Markham wrote:
> It is safe to reference additional uint64_t's that are stored in
> subsequent "rows" of a 2-d array through a pointer to the first
> element in the 2-d array.  So:
> 
> uint64_t caller_array[50][50];
> 
> remove_from_zobrist_hash(state, caller_array[0]);
> 
> ...will work, if the called function is aware that zobrist_numbers[50]
> is caller_array[1][0].

(I missed the beginning of the discussion.)

Use

void  
remove_from_zobrist_hash (..., uint64_t table[50][])
{
  ...
  /* e.g. */ table[2][4] = 0;
}

  ...
  uint64_t  a_table[50][50];

  remove_from_zobrist_hash (..., a_table);
  ...

(Untested.)

Paul


More information about the computer-go mailing list