ChinaUnix.net
相关文章推荐:

JdbcTemplateupdate 返回 int

编译的提示如下: 大概意思是说无效的左值..难道off_t 类型不能转换成int? #include #include #include #include #include #include void my_err(const char *err_string,int line) {   fprintf(stderr,"line:%d ",line);   perror(err_string);   exit(1); } int my_read(int fd) {   int ret,i,len;   cha...

by happytor - C/C++ - 2008-12-20 15:45:58 阅读(1685) 回复(5)

相关讨论

char *loopmove(char *str,int n){ int len=strlen(str); int pos=strlen(str)-n; char tmp[len+1];//最好不要这样char *tmp=(char *)malloc(len+1);这样还要在function外面free指针,麻烦 strcpy(tmp,str+pos); strcpy(tmp+n,str); *(tmp+len)='\0'; printf("%s\n",tmp); str=tmp; printf("%s\n",str); //return str;//我现在想返回这个值,应该怎么修改? } 2, #define MIN(a,b) ((a)<=(b)?(a):(b)) MIN(*p++,c);...

by xxldc - C/C++ - 2007-09-17 10:51:30 阅读(1885) 回复(4)

关于lseek函数的返回值类型off_t, 什么是long int ??? 在gdb中输入: ptype off_t, 提示是: long int ???

by redac - C/C++ - 2007-07-23 15:05:54 阅读(2901) 回复(1)

源代码如下: #ifndef X_H_ #define X_H_ #include #include #include using namespace std; template class cB{ private: vector<int> c; public: cB(){c.push_back(5);} vector::iterator f(){ vector::iterator itr; itr = c.begin(); return itr; } }; void main(int argc, char** argv){ cB<int> bb; vector<int>::iterator itr; itr = bb.f(); cout<<(*itr...

by guntone - C/C++ - 2006-07-24 16:22:48 阅读(1348) 回复(6)

请问int main()函数返回的0和1表示什么意思? 正常和非正常返回么? 请问exit(0)和exit(1)表示什么意思? 正常和非正常退出么?

by zp98133 - C/C++ - 2004-12-10 15:13:49 阅读(1062) 回复(2)

我在程序中已经 #include ; 了,可是还是提示我clock_t 没有声明过,找不到原因,头疼 阿! 想用unsigned int 或者double 代替这个类型,是不是可以呢?

by wind_fq - C/C++ - 2007-09-29 14:56:49 阅读(6432) 回复(9)

class MY{ public: static const int getAtomId(void){return 115;} }; class YOUR{ public: static const int getAtomId(void){return 116;} }; main(){ int i = 116; switch(i){ case MY::getAtomId(): cout << "my " << endl; break; case YOUR::getAtomId(): cout << "your" << endl; break; default: cout << "what???" << endl; } } 编译不过:The case expression must be an integral constant exp...

by jchc - C/C++ - 2009-05-07 11:09:01 阅读(1411) 回复(8)

_int是什么类型?

by wangledahai - C/C++ - 2007-06-25 18:47:26 阅读(941) 回复(4)

大家都知道new返回 void *. 而C++中不能从任何其它指针隐式转化为void *的。 那为什么这样可以呢? 编译器做了什么手脚?

by THEBEST - C/C++ - 2004-04-22 18:17:20 阅读(1647) 回复(9)

请教怎么理解这个: typedef int TYPENAME(int, char *, int)

by dannywu - C/C++ - 2006-08-16 13:03:25 阅读(848) 回复(2)

int是不是long int的简写 实际上只有short int和long int两种? 只写int是不是不好的写法?

by jronald - C/C++ - 2008-10-06 08:53:01 阅读(2391) 回复(17)