# include void p(int *x,int y){ ++*x; y=y+2; } void main() { int x=2,y=3; p(&y,y); printf("# includevoid p(int *x,int y){++*x;y=y+2;}void main(){int x=2,y=3;p(&y,y);printf("%d#%d",x,y);}

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 18:11:18
# include void p(int *x,int y){ ++*x; y=y+2; } void main() { int x=2,y=3; p(&y,y); printf(
xՒ[K`ǿʃbxH;Zְ{aPfJ# "Xe5Eoj?϶ nlipk`Fu(VD"neQBMCIu#"!+*(f5  -+,dH-XVl2_d+=DGHz+"(2Yq4spJINoNAڈ*&!cu٢I;ʢN4/,Geq HY4Ի# Ll:x!2黊9:╁ؐ$u

# include void p(int *x,int y){ ++*x; y=y+2; } void main() { int x=2,y=3; p(&y,y); printf("# includevoid p(int *x,int y){++*x;y=y+2;}void main(){int x=2,y=3;p(&y,y);printf("%d#%d",x,y);}
# include void p(int *x,int y){ ++*x; y=y+2; } void main() { int x=2,y=3; p(&y,y); printf("
# include
void p(int *x,int y){
++*x;
y=y+2;
}
void main()
{
int x=2,y=3;
p(&y,y);
printf("%d#%d",x,y);
}

# include void p(int *x,int y){ ++*x; y=y+2; } void main() { int x=2,y=3; p(&y,y); printf("# includevoid p(int *x,int y){++*x;y=y+2;}void main(){int x=2,y=3;p(&y,y);printf("%d#%d",x,y);}
2#4
p函数的 int *x
得到main中 y的地址
故p函数的 x指向 main的y
p中 *x 和 main的y 占用的是同一段内存,p里 ++*x
就是main的y加1了
p 的y 接收 main的y的值
p的y和main的y是两个不同的内存
p 里 不管 p的y怎么变都不影响 main的y
所以main里x不变还是2 y变为4

#include void Delay(int p,int q) ; void Display(int time) ; void key(void); int st[10] c 语言基础 合并排序 #includestdio.hvoid merge(int*a,int p,int q,int m){int t[20];int k[20];int n1=q-p+1;int n2=m-q;for(int i=0;i #include void fun(int p) { int d=2; p=d++; printf(“%d”,p);} main() { int a=1; fun(a); printf(“%d #include void main( ) { int a=3,b=5; int *p,*q; void f1(int x,int y);void f2(int *x,int *y);p=&a; q=&b;f1(*p,*q) ;printf(a=%d ,b=%d ,a,b);f2(p,q);printf(a=%d ,b=%d ,a,b);}void f1(int x,int y) { int t;t=x; x=y; y=t;}void f2(int *x,int *y) { int #include void modify(int x,int y) {cout C语言:有n个整数,使前面各数顺序向后移m个位置,最后m个数变成最前面m个数,写一个函数实现以上功能#include #include #include void main(){ void move(int *p,int n,int m);int a[30];int *p=a;int m,n;printf(input the n #include int inc(int a){ return(++a); }int multi(int*a,int*b,int*c){ return(*c=*a**b); }typedef int(FUNC1)(int in);typedef int(FUNC2) (int*,int*,int*);void show(FUNC2 fun,int arg1,int*arg2){FUNC1 p=&inc;int temp =p(arg1);fun(&temp,&arg1,arg2);printf( # include void p(int *x,int y){ ++*x; y=y+2; } void main() { int x=2,y=3; p(&y,y); printf(# includevoid p(int *x,int y){++*x;y=y+2;}void main(){int x=2,y=3;p(&y,y);printf(%d#%d,x,y);} #include void f(int *p,int*q); main() {int m=1,n=2,*r=&m; f(r,&n);printf(%d,%d,m,n);}#include void f(int *p,int*q);main(){int m=1,n=2,*r=&m;f(r,&n);printf(%d,%d,m,n);}void f(int *p,int *q){p=p+1;*q=*q+1;}运行后的结果是A 1,3 B 1,2 说说为 #include void main(){ int b=3;int a; int arr[]={6,7,8,9,10}; int *ptr=arr; *(ptr++)+=123;#include using namespace std;void main(){ int b=3;int a; int arr[]={6,7,8,9,10}; int *ptr=arr; *(ptr++)+=123; printf(%d,%d ,*(p #include int inc(int a) { return(++a); } int multi(int*a,int*b,int*c) { return(*c=*a**b); }typedef int(FUNC1)(int in);  typedef int(FUNC2) (int*,int*,int*);  void show(FUNC2 fun,int arg1,int*arg2)  {  INCp=&inc;  int temp =p(arg1) #include class base { Private:int x,y; public:void setxy(int a,int b){x=a;y=b;} void 分析下面程序的输出结果.#includeclass base{Private:int x,y;public:void setxy(int a,int b){x=a;y=b;}void show(base *p){cout #include int main(void) { static int a[4][4]; }#include int main(void) { static int a[4][4]; int *p[4],i,j; for(i = 0; i < 4; i++) p[i] = &a[i][0]; for(i = 0 ; i < 4; i++) { *(p[i] + i) = 1 ; *(p[i] + 4 - (i + 1)) = 1; } for(i = 0; i < 4; i++) { for( (希望逐步解析)满意则追加分数.#include #include void main(){int m,n,t,p,i,r;scanf(%d%d,&m,&n);if(m 转置矩阵#include <stdio.h> #include <stdlib.h> void able(int b[][],int a);int main (){ int a,b[a][a]; scanf("%d",&a); able(b[a][a],a); return 0;}void able(int b[][],int a){ int i,m,c[a][a],*(p)[a],*(q)[a 下面这个程序哪里有语法问题#include #define N 10void sele(int*p){int i,j,t;for(i=0;i #include void main( ) { int k=-3; if (k #include void mian() { int n; n=0; while(n