- Function
Allocate a copy of a string on the heap.
- Header
- Declaration
char* __fastcall__ strdup (const char* s);
- Description
strdup
allocates a memory block on the heap, big enough to hold a copy ofs
including the terminating zero. If the allocation fails,NULL
is returned, otherwises
is copied into the allocated memory block, and a pointer to the block is returned.- Limits
- The function is only available as fastcall function, so it may only be used in presence of a prototype.
- It is up to the caller to free the allocated memory block.
- Availability
ISO 9899
- See also
- Example
None.