请问这是怎么回事
这个程序运行后信息窗口中会出现Null pointer assignment 而不出现结果?main()
{ void calc(float x,float y,char opr);
float a,b;
char opr;
printf("\nInput experssion:");
scanf("%f%c%f",&a,opr,&b);
calc(a,b,opr);
}
void calc(float x,float y,char opr)
{ switch(opr)
{ case '+': printf("%5.2f%c%5.2f=%6.2f\n",x,y,x+y);return;
case '-': printf("%5.2f%c%5.2f=%6.2f\n",x,y,x+y);return;
case '*': printf("%5.2f%c%5.2f=%6.2f\n",x,y,x+y);return;
case '/': printf("%5.2f%c%5.2f=%6.2f\n",x,y,x+y);return;
}
}