我来送分了,大家接分

时间:2021-09-27 19:22:57
几个菜鸟的问题:
1.fprintf里的换行是什么参数
2.为什么WORD是不认的(我在console application里),是不是要什么头文件
3.BITMAPFILEHEADER里第二个参数是DWORD bfsize,我用二进制打开是:36 00 09 00.但文件的大小是576k,不  知两者是怎么联系的?

12 个解决方案

#1


1.\n
2.windef.h, 试试看
3.不知道

#2


没有啊,我试过\n,但输出的是一个小方块
好像是因为2000下的notepad是4个byte代表一个回车,但\n是1个,也不知对不对

希望大家帮忙了

#3


没人知道吗?

#4


\r\n 總可以了吧。

#5


right.谢了.但不知为什么是这样呢?
另外,第二个问题:
#include <windef.h>
void main()
{
WORD c1,c2;
}
也是不对,且错误很怪,是源文件错了,天啊,ft.

#6


\r\n一个是回车,一个是换行,
回车的作用是光标回到行首,换行的作用是使光标到下一行。

Windef.h一般是不用include的吧?
你的错误是什么具体说一下。

#7


\r\n一个是回车,一个是换行,
回车的作用是光标回到行首,换行的作用是使光标到下一行。

Windef.h一般是不用include的吧?
你的错误是什么具体说一下。

十六进制 090036 是十进制的589876约等于576K

#8


3.谢谢,原来应该是0900 3600这么看的
1.我的程序在上面
若不加windef.h
:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) :    error C2065: 'WORD' : undeclared identifier
d:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) : error C2146: syntax error : missing ';' before identifier 'c1'
d:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) : error C2065: 'c1' : undeclared identifier
d:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) : error C2065: 'c2' : undeclared identifier

加了.h是
g:\microsoft visual studio\vc98\include\winnt.h(3143) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
g:\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'PCONTEXT' : missing storage-class or type specifiers
g:\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'ContextRecord' : missing storage-class or type specifiers
Error executing cl.exe.

DIBINFO.exe - 3 error(s), 0 warning(s)

1.应该是这样的,但我想不通为什么\n出现的是一个小方块

谢谢你了.

#9


我试了一下,果然Console不能声明WORD,但是支持MFC的Console程序就没问题。
我也不知道为什么了。:)
不如你就用unsigned short,不要用WORD了。呵呵

#10


另:显示小方框因为\n属于不可打印的字符,所有不可打印的字符都应该显示为小方框吧。

#11


给我分吧

#12


谢.结分了.

#1


1.\n
2.windef.h, 试试看
3.不知道

#2


没有啊,我试过\n,但输出的是一个小方块
好像是因为2000下的notepad是4个byte代表一个回车,但\n是1个,也不知对不对

希望大家帮忙了

#3


没人知道吗?

#4


\r\n 總可以了吧。

#5


right.谢了.但不知为什么是这样呢?
另外,第二个问题:
#include <windef.h>
void main()
{
WORD c1,c2;
}
也是不对,且错误很怪,是源文件错了,天啊,ft.

#6


\r\n一个是回车,一个是换行,
回车的作用是光标回到行首,换行的作用是使光标到下一行。

Windef.h一般是不用include的吧?
你的错误是什么具体说一下。

#7


\r\n一个是回车,一个是换行,
回车的作用是光标回到行首,换行的作用是使光标到下一行。

Windef.h一般是不用include的吧?
你的错误是什么具体说一下。

十六进制 090036 是十进制的589876约等于576K

#8


3.谢谢,原来应该是0900 3600这么看的
1.我的程序在上面
若不加windef.h
:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) :    error C2065: 'WORD' : undeclared identifier
d:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) : error C2146: syntax error : missing ';' before identifier 'c1'
d:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) : error C2065: 'c1' : undeclared identifier
d:\my documents\vc练习\我的mfc\dibiformation\dibinfo.cpp(12) : error C2065: 'c2' : undeclared identifier

加了.h是
g:\microsoft visual studio\vc98\include\winnt.h(3143) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
g:\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'PCONTEXT' : missing storage-class or type specifiers
g:\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'ContextRecord' : missing storage-class or type specifiers
Error executing cl.exe.

DIBINFO.exe - 3 error(s), 0 warning(s)

1.应该是这样的,但我想不通为什么\n出现的是一个小方块

谢谢你了.

#9


我试了一下,果然Console不能声明WORD,但是支持MFC的Console程序就没问题。
我也不知道为什么了。:)
不如你就用unsigned short,不要用WORD了。呵呵

#10


另:显示小方框因为\n属于不可打印的字符,所有不可打印的字符都应该显示为小方框吧。

#11


给我分吧

#12


谢.结分了.