【发布时间】:2014-01-16 15:37:16
【问题描述】:
如果我有struct example *e,function(&e) 和 function(e) 有什么区别?
一个例子。
这是第一个代码:
#include <stdio.h>
struct example
{
int x;
int y;
};
void function (struct example **);
int main ()
{
struct example *e;
function (&e);
return 0;
}
void function (struct example **e)
{
/ * ... */
}
这是第二个代码:
#include <stdio.h>
struct example
{
int x;
int y;
};
void function (struct example *);
int main ()
{
struct example *e;
function (e);
return 0;
}
void function (struct example *e)
{
/ * ... */
}
这两个代码有什么区别? 谢谢!
【问题讨论】: