运行下面的程序,得到的结果却有错,为什么? #include<at892051.h> #include<stdlib.h> #include<string.h> #include<stdio.h>
void main() { unsigned int f; unsigned char k,i; unsigned char s[]="12.3"; unsigned char*pointer=s; SCON=0X50; TMOD=0X20; TH0=(256-2*11.0592*1000/32/12/9.6); TL0=(256-2*11.0592*1000/32/12/9.6); TR1=1; EA=1; TI=1;
k=sizeof(pointer); f=atoi(s); i=(char)f; printf("string %s,float=%d,sizeof=%d
",s,i,k); } 结果为string 12.3,float=3075,k=0;只有string对,其他都错,并且i>256(char 变量<=256;望请教 |