#include 为啥不能去掉h
#include<windows.h> 为什么不能去掉h
如题:C++标准不是规定标准头文件不应当加h吗
------解决方案--------------------
兄弟,你那个不是C++标准头文件哈。
读书太教条了。
------解决方案--------------------
windows.h 是平台SDK的东西 windows规定要加.h
------解决方案--------------------
文件名就是windows.h,去掉了哪里找这个文件.-_-#
------解决方案--------------------
说真的,一年多前我还把C++ Primer当神一样看,现在对他的批判远大于接受了
------解决方案--------------------
你可这样试试:
将编译器include下的windows.h改名为windows
然后用
#include <windows>
....
不过,这样有意义吗?
------解决方案--------------------
楼主还要注意,Windows SDK是纯C接口不是C++的,与C兼容是C++最大生命力之所在,如果没有这一条,C++早就消失的无影无踪了。
------解决方案--------------------
这只是个文件名....
------解决方案--------------------
------解决方案--------------------
哥只是传说 强势观望中
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------
MD,cstdio.h,我太有才了
------解决方案--------------------
Advice: Use the C++ Versions of C Library Headers
In addition to facilities defined specifically for C++, the C++ library incorporates the C library. The cctype header makes available the C library functions defined in the C header file named ctype.h.
The standard C headers names use the form name.h. The C++ versions of these headers are named cnamethe C++ versions remove the .h suffix and precede the name by the letter c. Thec indicates that the header originally comes from the C library. Hence, cctype has the same contents as ctype.h, but in a form that is appropriate for C++ programs. In particular, the names defined in the cname headers are defined inside the std namespace, whereas those defined in the .h versions are not.
Ordinarily, C++ programs should use the cname versions of headers and not the name.h versions. That way names from the standard library are consistently found in the std namespace. Using the .h headers puts the burden on the programmer to remember which library names are inherited from C and which are unique to C++.
这是C++ PRIMER里的原话,很明显,作者只是在提了个建议而已。远没有达到你所说的“护犊子”的程度。
------解决方案--------------------
win32用C写的,是这原因吗
------解决方案--------------------
哈~~,强势围观
------解决方案--------------------
因为是Windows,不是C++。
------解决方案--------------------
强势围观。。。
仅仅围观。
------解决方案--------------------
我也围观
------解决方案--------------------
如题:C++标准不是规定标准头文件不应当加h吗
------解决方案--------------------
兄弟,你那个不是C++标准头文件哈。
读书太教条了。
------解决方案--------------------
windows.h 是平台SDK的东西 windows规定要加.h
------解决方案--------------------
文件名就是windows.h,去掉了哪里找这个文件.-_-#
------解决方案--------------------
说真的,一年多前我还把C++ Primer当神一样看,现在对他的批判远大于接受了
------解决方案--------------------
你可这样试试:
将编译器include下的windows.h改名为windows
然后用
#include <windows>
....
不过,这样有意义吗?
------解决方案--------------------
楼主还要注意,Windows SDK是纯C接口不是C++的,与C兼容是C++最大生命力之所在,如果没有这一条,C++早就消失的无影无踪了。
------解决方案--------------------
这只是个文件名....
------解决方案--------------------
------解决方案--------------------
哥只是传说 强势观望中
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------
MD,cstdio.h,我太有才了
------解决方案--------------------
Advice: Use the C++ Versions of C Library Headers
In addition to facilities defined specifically for C++, the C++ library incorporates the C library. The cctype header makes available the C library functions defined in the C header file named ctype.h.
The standard C headers names use the form name.h. The C++ versions of these headers are named cnamethe C++ versions remove the .h suffix and precede the name by the letter c. Thec indicates that the header originally comes from the C library. Hence, cctype has the same contents as ctype.h, but in a form that is appropriate for C++ programs. In particular, the names defined in the cname headers are defined inside the std namespace, whereas those defined in the .h versions are not.
Ordinarily, C++ programs should use the cname versions of headers and not the name.h versions. That way names from the standard library are consistently found in the std namespace. Using the .h headers puts the burden on the programmer to remember which library names are inherited from C and which are unique to C++.
这是C++ PRIMER里的原话,很明显,作者只是在提了个建议而已。远没有达到你所说的“护犊子”的程度。
------解决方案--------------------
win32用C写的,是这原因吗
------解决方案--------------------
哈~~,强势围观
------解决方案--------------------
因为是Windows,不是C++。
------解决方案--------------------
强势围观。。。
仅仅围观。
------解决方案--------------------
我也围观
------解决方案--------------------