在下面的代码中,我向函数传递指向
以下代码有同样的问题:
*example[10];
的指针还是整个数组?#include <stdio.h>
void function (int **)
int main ()
{
int *example[10];
function(example);
return 0;
}
void function (int *example[10])
{
/* ... */
return;
}
以下代码有同样的问题:
#include <stdio.h>
struct example
{
int ex;
};
void function (struct example *)
int main ()
{
struct example *e;
function(e);
return 0;
}
void function (struct example *e)
{
/* ... */
return;
}
main()
中也会发生变化),而没有额外指针时只能在本地修改! - ᴜsᴇʀ