ChinaUnix.net
相关文章推荐:

error expected constructor destructo

#include int size(int num) {     char array[num+2];     return sizeof(array); } int main() {     printf("%d\n",size(4));     return(0);   } 为什么在vc里编译不过?

by lxbkey - C/C++ - 2008-08-02 11:59:25 阅读(8856) 回复(4)

相关讨论

我用 if [ $i -eq 100 ] 就出现了这个错误:integer expression expected 从字面上理解就是变量i应该是个integer类型的 但是如何把一个字符型数字转换成整形呢?

by cuer_2 - Shell - 2009-06-01 16:21:21 阅读(14004) 回复(11)

以下是port.sh的内容 #! /bin/bash # program: Using to study the [if... then ...fi] program # Written by :Beyond # date: 2007/06/15 # content: I will be using this program to show your services # 1. print the program's work in your screen echo "Now, the services of your Linux system will be detect!" echo "The www, ftp, ssh, and sendmail + pop3 will be detect!" echo " " # 2. www www='netstat ...

by beyond911 - Shell - 2007-06-17 13:35:31 阅读(14985) 回复(2)

(原标题为:求解:一个菜鸟编程中的问题!) 编写了一个shell命令cp 代码如下: #include #include #include #include #define maxOnce 1024 int main(int argc,char * argv[]) { int fdsrc,fddist; char buf[maxOnce]; char buf1[maxOnce]; int size; if(argc!=3) printf("error for input\n"); if((fdsrc=open(argv[1],O_RDONLY)==-1) perror("error for open\n ");//出错...

by melonmelon - C/C++ - 2006-12-28 20:35:32 阅读(4247) 回复(10)

原代码如下: fsmax="85" maillist1="[email]cold@163.com[/email]" maillist2="[email]hot@163.com[/email]" df -k | grep '/dev/h' | awk '{print $1,$5,$6}'>mailfile mail -s "Filesystem Information" $maillist1 < mailfile mail -s "Filesystem Information" $maillist2 < mailfile df -k | grep '/dev/h' | awk '{print $5}'>outfile while [ read fsvalue ] do fsvalue=$(echo $fsvalue | sed 's/\%//') ...

by wwmshe - Shell - 2006-05-17 14:13:03 阅读(1231) 回复(1)

[code]#include ; using namespace std; class X { public: X() throw(); X(const X&) throw(); }; X::X() throw() { cout << "default constructor\n"; } X::X(const X&) throw() { cout << "copy constructor\n"; } X userCode(X b) throw() { X c = b; return c; } ...

by lc1999 - C/C++ - 2005-08-31 17:06:20 阅读(2115) 回复(4)

代码情况比较复杂,不好说... 举例说吧,有三个文件 a.c a.h b.c,a.h中定义一个结构体,在另外两个文件都会用到,所以两个文件都include"a.h", a.h还声明了一些a.c中的函数,编译的时候就出现下面错误,这些错误就是在a.h里面的函数声明处, a.h中的结构体用了 typedef ,不知道这个有没有影响,因为看了一些文章,但是也没完全搞明白... 如果有人遇到过这个问题就最好了~~ In file included from detect.h:5, ...

by zuii - C/C++ - 2009-06-08 16:38:06 阅读(19129) 回复(5)

expected declaration or statement at end of input 是什么意思呀? 就着一个错在最后

by zhanglupanda - C/C++ - 2007-04-01 00:04:35 阅读(15872) 回复(5)

我写了一个程序,下面是该程序中的一部分。大体是这样的:重载前缀++,我执行了下面两组语句: 1. integer ii; ++ii; integer r0 = ii; 2.integer rr = ++ii; 这两组语句中我感觉应该都是调用2此copy constructor,但是实际上,第二种情况只调用了1次。 不知道为什么? #include using namespace std; class integer { public: int i; public: integer() {i = 0;} integer(const integer & ci) { i = ci....

by trueno - C/C++ - 2007-11-08 23:22:11 阅读(1250) 回复(1)

很久没有写java程序了,好多地方都忘了。这个程序给出的提示是,派生类生成时将自动调用基类的构造函数。而当基类与派生类拥有同样的成员变量时,须通过显示类型转换得以从派生类访问基类的同名成员变量。 //File Name : test.java //Description: Test Derived class.When the derived class invoke the constructor function. // The constructor will invoke the base class constructor firstly.The other thing // ...

by hoog - Java文档中心 - 2006-03-20 20:10:29 阅读(1192) 回复(0)

A::A(const A& a) { if (this !=&a) { delete count_; count_ = new int [*a->count_]; } else count = 0; return *this; } 這個我記不清怎麽寫了。。 1、copy constructor 有沒有什麽規範? 2、其中的*a 解引用爲什麽要用解引用呢? a.count_ 不可以麽? 解引用 應該怎樣用? 謝謝

by yjqyml - C/C++ - 2005-11-08 14:43:51 阅读(1535) 回复(14)