Here is a solution. I only slightly modified the code in your first post to make it work.
#include "DarkGDk.h"
const int COLUMNS = 5;
void function(float [][COLUMNS],int);
void printData(float [][COLUMNS],int);
void DarkGDK()
{
int Row;
dbPrint("Enter a Number");
Row = atoi(dbInput());
float (*pa)[COLUMNS] = new float[Row][COLUMNS];
printData(pa,Row);
//to print out the original array
function(pa,Row);
//the function will modify the original array ---
printData(pa,Row);
//to print out the new array[Row][Colums]
dbWaitKey();
delete[] pa;
}
void function(float arrayF[][COLUMNS],int i)
{
for(int x=0; x<i; x++)
{
for(int y=0; y<COLUMNS; y++)
{
arrayF[x][y]=x+y;
}
}
}
void printData(float arrayFF[][COLUMNS],int p)
{
char Buffer[256];
for(int x=0; x<p; x++)
{
for(int y=0; y<COLUMNS; y++)
{
//dbPrint(dbStr(arrayFF[x][y]));
sprintf(Buffer, "%0.5f", arrayFF[x][y]);
dbPrint(Buffer);
}
dbPrint(" ");
}
}
Note that "float *pa" is a "simple pointer", which you could use as a pointer to a one-dimensional array but not to a two-dimensional. To create a pointer to an array, you need to use the "float (*pa)[COLUMNS]" form. The brackets are necessary because "float *pa[COLUMNS]" would be an array of pointers and not a pointer to an array.
I also exchanged Columns for COLUMNS because constant names are usually written in uppercase but that's only a style question.
Variables are NOT automatically initialized to zero. If you create an array and immediately print out its values, without initializing the array, it will work but the values will be garbage. In a "real" program, make sure to always initialize your variables.
Finally, don't do this:
dbStr creates always a new string in memory when it is called, therefore it creates a memory leak if you don't delete[] the returned pointer after use. (By the way I'm not sure that dbInput does not have the same problem, so I would probably delete its returned pointer too when it's no longer needed.)
For printouts it is better to use the sprintf formatting function of C++, see the example above. I have also included an empty line printing after each row of the array, so that it's easier to see where a line ends. (You can try to further develop the program to print the values of one array row into one line on the screen, because the lines quickly scroll away and you won't be able to see most of the printouts.)