#include
by
iyxing
-
C/C++
-
2008-03-25 19:03:47 阅读(1536) 回复(1)
错误指向了这一行。 extern master_info_tp* pmaster_info; 我只是声明一个外部结构体指针,这么做不行?
[code]
#include
我定义了一个 # define ASSERT_ARGS(a) ((void)0) 然后在函数里面使用这个宏,比如: int foo(arg) { ASSERT_ARGS(arg); int i = 0; bar(i); return 1; } 但是编译会出现 iso C90 forbids mixed declarations and code 这个宏如何定义才能绕过这个错误? 不允许交换宏在代码中的位置,仅仅是改写这个宏,宏定义的代码必须能gcc 优化掉,比如((void)0). 这个好像有点难度,我一直没有找到方法。 ...
例如:
typedef vector
我看到STL中有这样的定义 explicit vector(size_type n, const T& v = T(), const A& al = A()); 但是第二个参数是什么东西呢?应该怎么使用这三个参数? 我一用三个参数调用就会提示我参数个数不正确,但是这个构造函数明明有三个参数的。? [ 本帖最后由 xb_parasite 于 2006-7-26 11:19 编辑 ]
/// 見stl_vector.h template<typename _InputIterator> vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { // Check whether it's an integral type. If so, it's n...
小弟写的一段代码:
#include
今天用新的 5.8 C++ compiler编译一个老程序的时候,出现这样的warning是为什么呢? 是报在typedef struct AAA这样的一行上。 哪位兄弟知道怎么避免掉这个warning?