猿问

大家帮我看看我第二个函数void 怎么运算不出来

#include<stdio.h>
#define OK  1
int prog6_2()
{
 int a=3,b=4,sum=0;
 int *pa,*pb,*psum;
 char ch;
 char *pch=&ch;

 pa=&a;
 pb=&b;
 psum=&sum;
 printf("指针变量的值:pa=%x pb=%x psum=%x\n",pa,pb,psum);
 printf("目标变量的值:a=%d pb=%d sum=%d\n",*pa,*pb,*psum);
 *psum=*pa+*pb;
 *pch='A';
 printf("运输结果;sum=%d\tch=%c\n",*(&sum),ch);
 printf("整型指针变量的+运算:pa=%x pa+1=%x\n",pa,pa+1);
 printf("字符型指针变量的+运算:pch=%x pch+1=%x\n",pch,pch+1);
 return OK;

}
void prog7_1()
{

 char c1,c2,c3;
 printf("Input three characters:\n");
 scanf("%c",&c1);
 scanf("%c",&c2);
 scanf("%c",&c3);
 printf("c1=%c\tASCII=%d\n",c1,c1);
 printf("c2=%c\tASCII=%d\n",c2,c2);
 printf("c3=%c\tASCII=%d\n",c3,c3);
 return OK;


}


int main()
{
 prog6_2();
 return OK;
 prog7_1();
}

wangc958
浏览 1110回答 1
1回答

wangc958

我知道哪里出问题了0000000000000
随时随地看视频慕课网APP
我要回答