Hi,
This is a simple question:
I have a function accepts double pointer, the prototype is:
// code begin
void foo(int **m);
{
// do something with m
}
// code end
It works fine. The problem now is that in my main function the user only provide 2D array type data, e.g.,
// code begin
main()
{
a[3][3]= ... // an array;
foo(a); // <== warning and the program not working
}
// code end
I changed the line "foo(a)" to "foo(&a)" but not helpful. Still giving me the same warning:
'int ** ' differs in levels of indirection from 'int (*)[3][3]'
The compiler is VC 6++ on Windows XP. Now I have to transfer the input 2D array into double pointer array. I think there must be something can do this. I checked some posts here on passing 2D array to a function but not work in this case.
Thanks
This is a simple question:
I have a function accepts double pointer, the prototype is:
// code begin
void foo(int **m);
{
// do something with m
}
// code end
It works fine. The problem now is that in my main function the user only provide 2D array type data, e.g.,
// code begin
main()
{
a[3][3]= ... // an array;
foo(a); // <== warning and the program not working
}
// code end
I changed the line "foo(a)" to "foo(&a)" but not helpful. Still giving me the same warning:
'int ** ' differs in levels of indirection from 'int (*)[3][3]'
The compiler is VC 6++ on Windows XP. Now I have to transfer the input 2D array into double pointer array. I think there must be something can do this. I checked some posts here on passing 2D array to a function but not work in this case.
Thanks