ChinaUnix.net
相关文章推荐:

ISO C forbids declaration of ‘vector’ with no type

#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 阅读(1536) 回复(1)

相关讨论

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

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

[code] #include int getline(char line[],int maxline); int serindex(char s[],char t[]); main(int argc,char *argv[]) { int i; int len; int MAXLINE = 1000; char line[MAXLINE]; printf("argc=%d\nargv=%s\nargc=%s\n",argc,argv[1],argv[2]); if(argc ==3){ while((len = getline(line,MAXLINE)) >0){ serindex(line,argv[2]); ...

by lvscluster - C/C++ - 2009-05-05 14:32:12 阅读(3230) 回复(2)

我定义了一个 # 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 阅读(16739) 回复(17)
by dengcainiao - 内核/嵌入技术 - 2006-12-12 14:58:38 阅读(492) 回复(0)

例如: typedef vector::size_type vec_sz; 编译时候出现如下报错信息: error c2653: ’vector>‘: is not a class or namespace name” 但是用 vector来声明一个变量的 时候就没有问题, 我用的是VC6.0,请问这个错误信息是什么意思?这个写法对吗? Thanks a lot!!

by plutowilliam - C/C++ - 2007-10-13 21:52:23 阅读(4905) 回复(14)

我看到STL中有这样的定义 explicit vector(size_type n, const T& v = T(), const A& al = A()); 但是第二个参数是什么东西呢?应该怎么使用这三个参数? 我一用三个参数调用就会提示我参数个数不正确,但是这个构造函数明明有三个参数的。? [ 本帖最后由 xb_parasite 于 2006-7-26 11:19 编辑 ]

by xb_parasite - C/C++ - 2006-08-02 15:01:40 阅读(3895) 回复(12)

/// 見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...

by dtimes6 - C/C++ - 2009-08-02 02:16:49 阅读(1904) 回复(2)

小弟写的一段代码: #include ..... #define PHONE_SET_MFPP  _IOW ('q', 0xc0, int) ... ioctl(fd, PHONE_SET_MFPP, value); ... 编译时总是报Warning: implicit declaration of function ‘PHONE_SET_MFPP’。 怎么才能不出现此warning?多谢!

by yypzgmmm - C/C++ - 2008-12-17 14:40:58 阅读(2113) 回复(3)

今天用新的 5.8 C++ compiler编译一个老程序的时候,出现这样的warning是为什么呢? 是报在typedef struct AAA这样的一行上。 哪位兄弟知道怎么避免掉这个warning?

by icesummit - C/C++ - 2006-11-08 17:30:25 阅读(1254) 回复(0)

请问vector数组有一维和多维的区别吗?如果有的话,能否分别举例说明,谢谢

by olivehht - Java - 2006-10-11 16:35:10 阅读(1350) 回复(1)