所以,我有一个功能如下:
void myfunction1(int *number)
{
...
}
我有:
void myfunction2(int *number)
{
...
myfunction1(&number);
}
当我运行代码时,我收到错误:
warning: passing argument 1 of ‘myfunction1’ from incompatible pointer type
所以我将第二个功能更改为:
void myfunction2(int *number)
{
...
myfunction1(&(*number));
}
我得到了:
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
有任何想法吗?