全部问题 > 当前问题

这个地方为啥是&x

#include  <stdio.h>
void fun(unsigned long  *n)
{ unsigned long  x=0, i;    int  t;
  i=1;
  while(*n)
/**********found**********/
  { t=*n % 10;
/**********found**********/
    if(t%2!= 0)
    { x=x+t*i;  i=i*10;  }
    *n =*n /10;
  }
/**********found**********/
  *n=&x;
}
main()
{ unsigned long  n=-1;
  while(n>99999999||n<0)
  { printf("Please input(0<n<100000000): "); scanf("%ld",&n); }
  fun(&n);
  printf("\nThe result is: %ld\n",n);
}

红色区域为啥是*n=x,不是*n=&x

不过二级不改名字 2019-3-22 19:12:20

共 1 个回答

【C语言】桦桦 2019-3-25 13:35:42

表示指针指向x的地址哦