编译的提示如下:
大概意思是说无效的左值..难道off_t 类型不能转换成int?
#include
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);...
关于lseek函数的返回值类型off_t, 什么是long int ??? 在gdb中输入: ptype off_t, 提示是: long int ???
源代码如下:
#ifndef X_H_
#define X_H_
#include
请问int main()函数返回的0和1表示什么意思? 正常和非正常返回么? 请问exit(0)和exit(1)表示什么意思? 正常和非正常退出么?
我在程序中已经 #include
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...