This is a sample code of my program.
I have a function named function
which is used to return an integer value and an integer array. I have to pass them as pointers (The signature of function
cannot be changed). So I wrote the below code. Here I have to assign the values to the double pointer passed to the function.
void function(unsigned int* count, unsigned int ** array)
{
for(unsigned int i = 0; i<4;i++)
{
//array[i] = (unsigned int*)i*10;
}
*count = 4;
}
int main()
{
unsigned int count;
unsigned int array2[4];
function(&count, (unsigned int**)&array2);
return 0;
}
But the above code is not working.