List244
asked on
Help with **
int *Function(int **,int *,int); //prototype
int *Function(int **y,int *z,int r)//function
Hi, can someone explain exactly what this is, and when it would be used?
Or possibly provide a tutorial on this subject?
int *Function(int **y,int *z,int r)//function
Hi, can someone explain exactly what this is, and when it would be used?
Or possibly provide a tutorial on this subject?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
int x[3][3] has dimension information in it i.e. it is int *x[3]. While **Array doesn't have any dimention information in it. So the are different datatypes and so can't be assigned to each other. Only one dimension can be "not specified". So you need to change it to
#include <iostream>
using namespace std;
int MyFunc(int (*Array)[3]);
int main()
{
int ret = 0;
int x[3][3]= {{1,2,3},{4,5,6},{7,8,9}};
ret = MyFunc(x);
return 0;
}
int MyFunc(int (*Array)[3])
{
return 0;
}
OR
#include <iostream>
using namespace std;
int MyFunc(int Array[][3]);
int main()
{
int ret = 0;
int x[3][3]= {{1,2,3},{4,5,6},{7,8,9}};
ret = MyFunc(x);
return 0;
}
int MyFunc(int Array[][3])
{
return 0;
}
#include <iostream>
using namespace std;
int MyFunc(int (*Array)[3]);
int main()
{
int ret = 0;
int x[3][3]= {{1,2,3},{4,5,6},{7,8,9}};
ret = MyFunc(x);
return 0;
}
int MyFunc(int (*Array)[3])
{
return 0;
}
OR
#include <iostream>
using namespace std;
int MyFunc(int Array[][3]);
int main()
{
int ret = 0;
int x[3][3]= {{1,2,3},{4,5,6},{7,8,9}};
ret = MyFunc(x);
return 0;
}
int MyFunc(int Array[][3])
{
return 0;
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
#include <iostream>
using namespace std;
int MyFunc(int **Array);
int main()
{
int ret = 0;
int x[3][3]= {{1,2,3},{4,5,6},{7,8,9}};
ret = MyFunc(x);
return 0;
}
int MyFunc(int **Array)
{
return 0;
}