“::”是域运算符常用方式“类名::方法名”
“.”是delphi中“对象名.成员函数”
“->”是c++builder中“对象名->成员函数()”
“.”在c++builder中也有用到例如
char* cp = Edit1->Text.c_str();
char* cp2 = strtok( cp, " \t\n" ); // cp may no longer be valid
If you need a persistent pointer, you MUST copy the string into its own buffer: char* cp = new char[ Edit1->Text.Length() + 1 ];
strcpy( cp, Edit1->Text.c_str() );
“.”是delphi中“对象名.成员函数”
“->”是c++builder中“对象名->成员函数()”
“.”在c++builder中也有用到例如
char* cp = Edit1->Text.c_str();
char* cp2 = strtok( cp, " \t\n" ); // cp may no longer be valid
If you need a persistent pointer, you MUST copy the string into its own buffer: char* cp = new char[ Edit1->Text.Length() + 1 ];
strcpy( cp, Edit1->Text.c_str() );
是指针时使用->
->指针引用
::作用域
都能用就没什么区别!
->指针引用
::作用域
.-> 类成员的指针引用
.* 类成员指针的值引用