ChinaUnix.net
相关文章推荐:

ISO C90 forbids mixed declarations and code

我定义了一个 # 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). 这个好像有点难度,我一直没有找到方法。 ...

by zhuomingliang - C/C++ - 2010-11-17 11:03:36 阅读(11611) 回复(17)

相关讨论
by dengcainiao - 内核/嵌入技术 - 2006-12-12 14:58:38 阅读(264) 回复(0)

#include using namespace std; class Deta {public: Deta(int,int,int); Deta(int,int); Deta(int); Deta(); void display(); private: int x; int y; int z; } Deta :: Deta(int a,int b,int c): x(a),y(b),z(c) {} Deta :: Deta(int a,int b): x(a),y(b) { z=2006; } Deta :: Deta(int a): x(a) { y=1; z=2006; } Deta:: Deta() { x=10; y=1; z=2006; } void Deta::display() {cout<

by iyxing - C/C++ - 2008-03-25 19:03:47 阅读(1003) 回复(1)

错误指向了这一行。 extern master_info_tp* pmaster_info; 我只是声明一个外部结构体指针,这么做不行?

by wang9736 - C/C++ - 2008-11-12 15:51:14 阅读(3601) 回复(6)

A type specifier of the form struct-or-union identifier { struct-declaration-list } declares the identifier to be the tag of the structure or union specified by the list. A subsequent declaration in the same or an inner scope may refer to the same type by using the tag in a specifier without the list: struct-or-union identifier 上面蓝色字体部分不太明白它的意思是怎样的struct, 可以用...

by shihyu - C/C++ - 2007-06-13 00:05:32 阅读(774) 回复(0)

A very special rule applies to declarations of the form struct-or-union identifier; that declare a structure or union, but have no declaration list and no declarators. Even if the identifier is a structure or union tag already declared in an outer scope (Par.A.11.1), this declaration makes the identifier the tag of a new, incompletely-typed structure or union in the current scope. This ...

by shihyu - C/C++ - 2007-06-11 21:04:32 阅读(994) 回复(2)

from: http://www.cs.usfca.edu/~parrt/course/652/lectures/cdecls.html [code] Even experienced C programmers have difficulty reading declarations that go beyond simple arrays and pointers. For example, is the following an array of pointers or a pointer to an array? int *a[10]; What the heck does the following mean? int (*(*vtable)[])(); Naturally, it's a pointer to an array of pointers to fun...

by zwylinux - C/C++ - 2007-03-28 17:43:38 阅读(760) 回复(3)

Static class declarations Can a class -- inner or outer -- be declared static? By Java Q&a Experts, JavaWorld.com, 08/20/99 Can a class (whether an inner or outer class) be declared static? In order to understand the use of the static keyword in class declaration, we need to understand the class declaration itself. You can declare two kinds of classes: top-level classes and inner classes. Top-l...

by heavenflying - Java文档中心 - 2007-03-07 13:28:36 阅读(381) 回复(0)

DECLARE CURSOR TCURSOR IS SELECT Itemcode FROM Item; TYPE TRS IS REF CURSOR RETURN TCURSOR%ROWTYPE; RS TRS; BEGIN EXECUTE IMMEDIATE 'SELECT Itemcode FROM Item' INTO RS; END; 请问这段语句为什么会出错?

by yillen - Oracle - 2003-02-20 15:03:19 阅读(821) 回复(1)

我下的FB7。0R i386的MD5不对呀,是怎么回事? 我用网际快车下的,但在虚拟机上可以安装。

by zlhgood - BSD - 2008-03-03 21:14:07 阅读(2593) 回复(10)

谁有2950 交换机的iso 文件?

by hush110 - 网络技术 - 2006-07-18 18:03:39 阅读(597) 回复(0)