CFStringCreateWithCString

Header: CFString.h Carbon status: Supported

Creates an immutable CFString object from a C string.

CFStringRef CFStringCreateWithCString (
    CFAllocatorRef alloc, 
    const char *cStr, 
    CFStringEncoding encoding
);
Parameter descriptions
alloc

Pass a reference to an allocator object to be used to create the object or pass NULL to request the default allocator.

cStr

Pass a pointer to a NULL-terminated C string to be used to create the CFString object.

encoding

Pass an enum constant of type CFStringEncoding that specifes the encoding of the characters in the C string.

function result

A reference to an immutable CFString object or NULL if there was a problem creating the object.

DISCUSSION

The CFStringCreateWithCString function creates an immutable CFString object from the character contents of a C string (after stripping off the NULL terminating character).

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)