c写入指针的指针到文件如何实现?
时间:2010-08-14
来源:互联网
int main (void)
{
unsigned int un = 3000000000;
short end = 200;
long big = 65537; long long evrybig = 12345678908642;
printf ("un = %u and not %d\n", un, un);
printf ("end = %hd and %d\n", end, end);
printf ("big = %ld and not %hd\n", big, big);
printf ("verybig = %lld and not %ld\n", verybig, verybig);
return 0;
}
这是我的源代码,接着我进行编译,就出现以下错误:
print2.c: In function 'main':
print2.c:4: warning: this decimal constant is unsigned only in ISO C90
print2.c:6: warning: integer constant is too large for 'long' type
print2.c:9: warning: format '%hd' expects type 'int', but argument 3 has type 'long int'
print2.c:10: warning: format '%ld' expects type 'long int', but argument 3 has type 'long long int'
希望谁能指点一下,谢谢了。
作者: wackyjason 发布时间: 2010-08-14
警告内容:数据类型不一样
作者: iSIX 发布时间: 2010-08-14

作者: pocoyo 发布时间: 2010-08-14
我这会又编写了以下这个程序:
#include <stdio.h>
int main (void)
{
char ch;
printf ("Please enter a character.\n":);
scanf ("%c", &ch);
printf ("The code for %c is %d.\n", ch, ch);
return 0;
}
在运行的过程中我输入的字母“c”,在书上为(ASCII码)环境下,反应为:
The code for c is 67.
然而在我的电脑上却是:
The code for c is 99.
这说明我是使用的什么字符集呢?
作者: wackyjason 发布时间: 2010-08-14
int main (void)
{
unsigned int un = 3000000000;
short end = 200;
long big = 65537; long long evrybig = 12345678908642;
printf ("un = %u and not %d\n", un, un);
printf ("end = %hd and %d\n", end, end);
printf ("big = %ld and not %hd\n", big, big);
printf ("verybig = %lld and not %ld\n", verybig, verybig);
return 0;
}
这是我的源代码,接着我进行编译,就出现以下错误:
print2.c: In function 'main':
print2.c:4: warning: this decimal constant is unsigned only in ISO C90
print2.c:6: warning: integer constant is too large for 'long' type
print2.c:9: warning: format '%hd' expects type 'int', but argument 3 has type 'long int'
print2.c:10: warning: format '%ld' expects type 'long int', but argument 3 has type 'long long int'
希望谁能指点一下,谢谢了。
作者: wackyjason 发布时间: 2010-08-14
警告内容:数据类型不一样
作者: iSIX 发布时间: 2010-08-14

作者: pocoyo 发布时间: 2010-08-14
我这会又编写了以下这个程序:
#include <stdio.h>
int main (void)
{
char ch;
printf ("Please enter a character.\n":);
scanf ("%c", &ch);
printf ("The code for %c is %d.\n", ch, ch);
return 0;
}
在运行的过程中我输入的字母“c”,在书上为(ASCII码)环境下,反应为:
The code for c is 67.
然而在我的电脑上却是:
The code for c is 99.
这说明我是使用的什么字符集呢?
作者: wackyjason 发布时间: 2010-08-14
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28