Good grief!
n.aggel, you had the right idea to begin with, only your syntax needs help. Don't change the definition of the function, but just pass the appropriate pointer.
void array_function(int rows, int cols, float after[rows][cols] , float before[rows][cols])
{
...
}
int main()
{
int n = 5;
int m = 6;
int before[n][m];
int after[n][m];
array_function( 5, 6, before, after ); // this works
array_function( 5, 6, after, before ); // this works
...
}
Hope this helps.