下面这个代码里报错说“Line 16 incompatible types in assignment”,我不知为什么会出这种问题,请各位指点,谢谢!
/* Two D array pointer assignment from string-returning functions*/
#include
by mcmay - C/C++ - 2008-11-11 23:40:33 阅读(5327) 回复(5)
main函数中要读到整个文件,调用函数: readfile(char * filename, char * file_buf); main函数中定义: char * file_content; main函数中调用: readfile(filename,file_content); file_buf在函数readfile中明明已经读出内容,为什么file_content总是空? 请指点,多谢!
[code]#include
问题, 处理特殊字符时不正确,使用网上的方面也不成功, 下面是代码,但特殊字符没有显示出来,请下载附件。 [code]class string_handler { // 1: means the string is utf-8 // 0: means the string is gbk/gb2312 static $isUtf8 = 1; public function __construct(){ die("not allow to implement a new object"); } public static function strlen($str) { return self::$isUtf8 ? strlen(self::...
下面代码:
[code]#include
我有几个数组 array0= (1 2 3 6 ) array1= (2 4 1 0 5 9 3 ) array2= (2 4 6 3 1 7 2 1 8) 还有一个变量tmp; 我现在的想法是: while [ $i -lt 0 ] do tmp="array$i" 将tmp变成一个数组,然后对数组元素:em12:进行操作 ==========这个地方该怎么办啊!!! done
a.h头文件 #ifndef A_H_ #define A_H_ class Cd { private: static const int NUM=50; char performers[NUM]; char label[NUM]; int selections; double playtime; public: Cd(const char * s1,const char * s2,int n,double x); Cd(const Cd & d); Cd(); ~Cd(); virtual void Report()const; Cd & operator=(const Cd & d); }; class...
不知道项目中开了什么编译选项,我在做指针赋值时,例如 char *str = "hello"; 有如下警告: warning: initialization discards qualifiers from pointer target type 试了半天都没解决,请哪位熟悉C标准同志解释一下啊,跪谢!
//问题一: char* buf; buf=new char[5]; strcpy(buf,"aaaa"); buf=new char[10]; strcpy(buf,"bbbb"); //请问现在buf占用内存是多少?会是两次new 的累加吗? //问题二: char* buf2; buf2=new char[1]; strcpy(buf2,"1234567890123"); printf("%s\n",buf2); //这段代码执行正常,是意外还是合法? //new char[x] 中的x只是为了检查系统是否有x空间? //请指点迷津,不胜感激!!! [ 本帖最后由 zhaocong94005...
#include