while the vector version will be much safer, i believe the correct old school syntax should be:
void foo(int * a, int sizeX, int sizeY, int value)
{
a[sizeY*sizeof(int)+sizeX]=value;
}
No need for sizeof(int) at all. No need for sizeY at all. You need the stride (sizeX), and the indices of the elements you intend to access. You got this right in your second post: array[y*max_x+x]=value;
and you'll need to know the size of the array to resolve the address. so you end up passing array, x, y, max_x, and max_y for both one and two dimensional arrays!
You don't need sizeY for accessing elements -- You need it for bounds checking, if that's your bag -- but sizeX is sufficient for access.