Well, you could have a zeroOut member function that you call on all the nodes.
If you have to use memset, you can call memset in a loop.
1 2 3 4
for (int i = 0; i < 50; ++i)
{
std::memset(PathfindingGrid[i], 0, 50 * sizeof(PathfinderNode));
}
But I guess you don't want that ...
Can the grid dimensions change? If not, why not define PathfindingGrid as PathfinderNode PathfindingGrid[50][50];
That will make all nodes to be stored contiguous in memory so that you can use a single call to memset.
Another way is to define PathfindingGrid as PathfinderNode* PathfindingGrid;
and allocate all the nodes in one call to new. PathfindingGrid = new PathfinderNode[H * W];
To access an element at position (x, y) you do PathfindingGrid[W * y + x]
I used W and H here as values for the width and height of grid.