Logo Search packages:      
Sourcecode: qt4-x11 version File versions

char * qstrdup ( const char *  src  )  [related]

Returns a duplicate string.

Allocates space for a copy of src, copies it, and returns a pointer to the copy. If src is 0, it immediately returns 0.

Ownership is passed to the caller, so the returned string must be deleted using delete[].

Definition at line 76 of file qbytearray.cpp.

References qstrcpy().

    if (!src)
        return 0;
    char *dst = new char[strlen(src) + 1];
    return qstrcpy(dst, src);

Generated by  Doxygen 1.6.0   Back to index