Python 官方文档:入门教程 => 点击学习
#include <stdio.h> f(int *i,int *j) { *i = 4; *j = 5; return 0; } int main(void) { int a = 3,b = 5; f
#include <stdio.h>
f(int *i,int *j)
{
*i = 4;
*j = 5;
return 0;
}
int main(void)
{
int a = 3,b = 5;
f(&a,&b); //发送a和b的地址到函数f,然后修改该地址的数值
printf("a = %d,b = %d\n",a,b);
}
#include <stdio.h>
//________________________________________________________________________________________________
//——————————————————————————————————————————————————
//_____________________________________________________________________________________
void f(int *p,int len)
{
p[3] = 88;
printf("%#X,%d\n",&p[3],p[3]); //0X19FF38,88
}
int main(void)
{
int a[5] = {1,2,3,4,5};
printf("%#X,%d\n",&a[3],a[3]); //0X19FF38,4
f(a,6);
printf("%#X,%d\n",&a[3],a[3]); //0X19FF38,88
return 0;
}
--结束END--
本文标题: 指针3
本文链接: https://lsjlt.com/news/183289.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0