using namespace std;
int main() {
char * p = CORBA::string_alloc(5); // Allocates 6 bytes
strcpy(p, "Hello"); // OK, "Hello" fits
cout << p << endl;
CORBA::string_free(p);
CORBA::String_var s = CORBA::string_dup("World");
cout << s.in() << endl;
文章来源于领测软件测试网 https://www.ltesting.net/