So, I have one function like the following:
void myfunction1(int *number)
{
...
}
And I have:
void myfunction2(int *number)
{
...
myfunction1(&number);
}
When I run the code I get the error:
warning: passing argument 1 of ‘myfunction1’ from incompatible pointer type
So I changed my second function to:
void myfunction2(int *number)
{
...
myfunction1(&(*number));
}
And I got:
dev(887) malloc: *** error for object 0x7fd400403810: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
Any ideas?
myfunction1(number);