Skip navigation.

CORBA Programming Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


CORBA::string_alloc

Synopsis

Allocates memory for a string.

C++ Binding

char * CORBA::string_alloc(ULong len); 

Argument

len

The length of the string for which to allocate memory.

Description

This member function dynamically allocates memory for a string, or returns a nil pointer if it cannot perform the allocation. It allocates len+1 characters so that the resulting string has enough space to hold a trailing NULL character. Free the memory allocated by this member function by calling the CORBA::string_free member function.

This function does not throw CORBA exceptions.

Return Values

If the function succeeds, the return value is a pointer to the newly allocated memory for the string object; if the function fails, the return value is a nil pointer.

Example

char* s = CORBA::string_alloc(10);

See Also

CORBA::string_free
CORBA::string_dup

 

Skip navigation bar  Back to Top Previous Next