以前从来没有看到过这个,请问这一句是什么意思#pragma a
如上。 问题点数:20、回复次数:10Top
1 楼Cybergate()回复于 2003-04-02 21:54:41 得分 3
好像没这个东西,至少vc7里没有Top
2 楼alan118(The Server Side)回复于 2003-04-02 22:57:02 得分 2
我在vc6里看到过,不过也不知道是什么。upTop
3 楼chengdulang(CD哑)回复于 2003-04-03 08:53:04 得分 5
#pragam 是宏指令
用法 #pragma 名字
如果是在tc中有2个名字可用
1 #pragma inline 表示程序内含inline汇编玛。
2 #pragma warn 该宏指令与许可编译任选项-wxxx所指定的xxx相同,但由于#pragma warn 所指定的xxx优先。
Top
4 楼comptometer(valor)回复于 2003-04-03 09:19:17 得分 5
msdn的解释:
Each implementation of C and C++ supports some features unique to its host machine or operating system. Some programs, for instance, need to exercise precise control over the memory areas where data is placed or to control the way certain functions receive parameters. The #pragma directives offer a way for each compiler to offer machine- and operating-system-specific features while retaining overall compatibility with the C and C++ languages. Pragmas are machine- or operating-system-specific by definition, and are usually different for every compiler.
Top
5 楼liuheliaoshi7879(虾米)回复于 2003-04-03 10:36:51 得分 0
学 习Top
6 楼robertnet(大师兄)回复于 2003-04-03 11:00:57 得分 0
#pragam 是宏指令,现在一般都不用了。Top
7 楼BlueSky2008(懒惰是程序员的美德)回复于 2003-04-03 11:21:54 得分 2
#pragam 是宏指令.用与在编译时控制编译器行为.现在仍广泛使用.
如win32 及MFC application wizard 生成的stdafx.h文件中,就有一句:
#progra once
表示此文件只编译一次.Top
8 楼woxihuanbohe(我喜欢)回复于 2003-04-03 12:53:28 得分 1
#progra inline 表示编译器将支持内联!!????Top
9 楼DanielWYO(爱上小白)回复于 2003-04-03 13:42:54 得分 1
在MSDN中用pragma查找看看就知道了.
另外说明,#pragma的实现由编译器自己定义,所以每个编译器都有所不同.
要知道别的编译器的情况,请查阅各自的helpTop
10 楼DanielWYO(爱上小白)回复于 2003-04-03 13:47:25 得分 1
alloc_text
comment
init_seg1
optimize
auto_inline
component
inline_depth
pack
bss_seg
data_seg
inline_recursion
pointers_to_members1
check_stack
function
intrinsic
setlocale
code_seg
hdrstop
message
vtordisp1
const_seg
include_alias
once
warning
以上是VC6.0中的支持的#pragma
to robertnet(三极管) :
"#pragam 是宏指令,现在一般都不用了"
真的吗??
//-------------------------------------------------------------------------------
很多语言中没有设置的东西就要在#pragma中设定,如果你做过静态链接库应该会用到#pragma的.Top




