EXACT STRING MATCHING ALGORITHMS
Animation in Java
http://www-igm.univ-mlv.fr/~lecroq/string/
2011年4月3日 星期日
2011年3月30日 星期三
const string in class
常數字串須在類別外初始化
http://bbs.chinaunix.net/archiver/?tid-953427.html
fiowrf 发表于 2007-06-25 11:38
class Operator:public BaseStructure{
private:
OperatorType mType;
static int ar[6];
static const string OperatorSymbol[7]={"+","-","*","/","^","??"};
public:
}
结果提示错误:
Operator.hxx:13: error: invalid in-class initialization of static data member
of non-integral type `const std::string[7]'
_Erics 发表于 2007-06-25 12:53
在类外初始化
class Operator:public BaseStructure{
private:
OperatorType mType;
static int ar[6];
static const string OperatorSymbol[7];
public:
}
const string Operator:OperatorSymbol[]={"+","-","*","/","^","??"};
gooderfeng 发表于 2007-06-25 13:00
静态数据在c++中只有 static const int t = 0;
可以初始化。
其他都要在类的外面。
http://bbs.chinaunix.net/archiver/?tid-953427.html
fiowrf 发表于 2007-06-25 11:38
class Operator:public BaseStructure{
private:
OperatorType mType;
static int ar[6];
static const string OperatorSymbol[7]={"+","-","*","/","^","??"};
public:
}
结果提示错误:
Operator.hxx:13: error: invalid in-class initialization of static data member
of non-integral type `const std::string[7]'
_Erics 发表于 2007-06-25 12:53
在类外初始化
class Operator:public BaseStructure{
private:
OperatorType mType;
static int ar[6];
static const string OperatorSymbol[7];
public:
}
const string Operator:OperatorSymbol[]={"+","-","*","/","^","??"};
gooderfeng 发表于 2007-06-25 13:00
静态数据在c++中只有 static const int t = 0;
可以初始化。
其他都要在类的外面。
2011年3月6日 星期日
2010年10月23日 星期六
C string is constant!?
char s[]={'c','o','\0'};
andchar s[]="co";
are equal.--------------------------------------------------------------
char * s = "co"; //this is a constant string
function("abc");
//"abc" is also a constant string. You can not change this string
It's just likeconst char s[]="co";
訂閱:
文章 (Atom)