'How do I pass and manipulate the arguments of a matrix into the function using pointers?
i have managed to send the arguments using pointers and matrix size inside of main like so:
int main()
{
swap(*(matrix+0)+1, 0, 1, *(matrix+3)+2, 3, 2);
}
my question really is, how do I swap out these two values of the matrix using the following function?
this is what I have so far in regards to the function:
void swap(float **a, int i, int j, float **b, int x, int y)
{
float temp;
temp = *(a+i)+j;
*(a+i)+j = *(b+x)+y;
*(b+x)+y = temp;
}
The errors are: incomaptible types when assigning to type 'float' from type 'float *', and lvalue required as left operand of assignment.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
