所以,我有一个功能类似如下:Ç - 传递一个指针的指针到另一个功能
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
任何想法?
只是'myfunction1(数);' – BLUEPIXY