CFStringCreateWithCStringHeader: CFString.h

Creates an immutable CFString object from a C string.

CFStringRef CFStringCreateWithCString (
    CFAllocatorRef alloc, 
    const char *cStr, 
    CFStringEncoding encoding
);
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).


© 1999 Apple Computer, Inc. — (Last Updated 9/15/99)