首页上一页 1 下一页尾页 1 条记录 1/1页
实在找不出来错误
发表在C语言图书答疑
2016-06-22
是否精华
是
否
版块置顶:
是
否
#include<stdio.h>
int main()
{
char cChar;
short int iShort;
int ilnt;
float fFloat=70000;
cChar=(char)fFloat;
iShort=(short)fFloat;
ilnt=(int)fFloat;
printf("the char is :%c\n",cChar);
printf("the long is :%\ld\n",iShort);
printf("the int is :%d\n",ilnt);
printf("the float is :%f\n",fFloat);
return 0;
}
结果
-------------------Configuration: hehe - Win32 Debug--------------------
Compiling...
hello.c
C:\Users\Administrator\Desktop\hello.c(15) : warning C4129: 'l' : unrecognized character escape sequence
hello.obj - 0 error(s), 0 warning(s)
int main()
{
char cChar;
short int iShort;
int ilnt;
float fFloat=70000;
cChar=(char)fFloat;
iShort=(short)fFloat;
ilnt=(int)fFloat;
printf("the char is :%c\n",cChar);
printf("the long is :%\ld\n",iShort);
printf("the int is :%d\n",ilnt);
printf("the float is :%f\n",fFloat);
return 0;
}
结果
-------------------Configuration: hehe - Win32 Debug--------------------
Compiling...
hello.c
C:\Users\Administrator\Desktop\hello.c(15) : warning C4129: 'l' : unrecognized character escape sequence
hello.obj - 0 error(s), 0 warning(s)